Pārlūkot izejas kodu

feat: change client collection's category

yusuf 1 mēnesi atpakaļ
vecāks
revīzija
ab7dff742a
4 mainītis faili ar 18 papildinājumiem un 18 dzēšanām
  1. 3 3
      API_DOCUMENTATION.md
  2. 4 4
      src/collections/Clients.ts
  3. 1 1
      src/payload-types.ts
  4. 10 10
      src/scripts/seed.ts

+ 3 - 3
API_DOCUMENTATION.md

@@ -90,8 +90,8 @@ Mengambil daftar clients dengan pagination dan filtering.
 - `limit` - Jumlah item per halaman (default: 10)
 - `sort` - Sorting field (contoh: `name` untuk ascending, `-name` untuk descending)
 - `where[category][equals]` - Filter berdasarkan category:
-  - `"Banking & Finance"`
-  - `"Enterprise & Industrial"`
+  - `"Banking"`
+  - `"Insurance"`
   - `"Government"`
 - `where[name][contains]` - Search berdasarkan nama client (case-insensitive)
 - `depth` - Depth untuk populate logo relationship (default: 0, gunakan 1 untuk populate logo object)
@@ -110,7 +110,7 @@ Mengambil daftar clients dengan pagination dan filtering.
 - `name` - Client name (string)
 - `href` - Website URL (string)
 - `logo` - Media object atau ID (relationship ke `media`)
-- `category` - Category (string, salah satu dari tiga opsi di atas)
+- `category` - Category (string, salah satu dari tiga opsi di atas: `Banking`, `Insurance`, `Government`)
 - `imageHeight` - Optional image height in pixels (number)
 - `createdAt` - Creation timestamp (ISO date string)
 - `updatedAt` - Last update timestamp (ISO date string)

+ 4 - 4
src/collections/Clients.ts

@@ -39,12 +39,12 @@ export const Clients: CollectionConfig = {
       required: true,
       options: [
         {
-          label: 'Banking & Finance',
-          value: 'Banking & Finance',
+          label: 'Banking',
+          value: 'Banking',
         },
         {
-          label: 'Enterprise & Industrial',
-          value: 'Enterprise & Industrial',
+          label: 'Insurance',
+          value: 'Insurance',
         },
         {
           label: 'Government',

+ 1 - 1
src/payload-types.ts

@@ -228,7 +228,7 @@ export interface Client {
   name: string;
   href: string;
   logo: number | Media;
-  category: 'Banking & Finance' | 'Enterprise & Industrial' | 'Government';
+  category: 'Banking' | 'Insurance' | 'Government';
   imageHeight?: number | null;
   updatedAt: string;
   createdAt: string;

+ 10 - 10
src/scripts/seed.ts

@@ -88,49 +88,49 @@ const clients = [
         href: 'http://www.btn.co.id',
         imageFile: 'btn.png',
         imageHeight: 42,
-        category: 'Banking & Finance',
+        category: 'Banking',
     },
     {
         name: 'Bank Internasional Indonesia',
         href: 'http://www.bii.co.id',
         imageFile: 'bii.png',
         imageHeight: 50,
-        category: 'Banking & Finance',
+        category: 'Banking',
     },
     {
         name: 'Bank Sinarmas',
         href: 'http://www.banksinarmas.com',
         imageFile: 'bsim.png',
         imageHeight: 42,
-        category: 'Banking & Finance',
+        category: 'Banking',
     },
     {
         name: 'Telkomsel',
         href: 'http://telkomsel.com/',
         imageFile: 'tsel.png',
         imageHeight: 56,
-        category: 'Enterprise & Industrial',
+        category: 'Insurance',
     },
     {
         name: 'Honda Prospect Motor',
         href: 'http://www.hpm.co.id',
         imageFile: 'hpm.jpg',
         imageHeight: 56,
-        category: 'Enterprise & Industrial',
+        category: 'Insurance',
     },
     {
         name: 'Bank Tabungan Negara - Syariah',
         href: 'http://www.btn.co.id/Syariah/Home.aspx',
         imageFile: 'btns1.png',
         imageHeight: 44,
-        category: 'Banking & Finance',
+        category: 'Banking',
     },
     {
         name: 'Bank Negara Indonesia',
         href: 'http://www.bni.co.id',
         imageFile: 'bni.png',
         imageHeight: 24,
-        category: 'Banking & Finance',
+        category: 'Banking',
     },
     {
         name: 'Direktorat Jenderal Bea dan Cukai',
@@ -144,7 +144,7 @@ const clients = [
         href: 'http://www.sinarmasforestry.com/Default.asp',
         imageFile: 'smf2.png',
         imageHeight: 48,
-        category: 'Enterprise & Industrial',
+        category: 'Insurance',
     },
 ]
 
@@ -441,8 +441,8 @@ async function seed() {
                         href: clientData.href,
                         logo: mediaId,
                         category: clientData.category as
-                            | 'Banking & Finance'
-                            | 'Enterprise & Industrial'
+                            | 'Banking'
+                            | 'Insurance'
                             | 'Government',
                         imageHeight: clientData.imageHeight,
                     },