From 63d99a36dc1cc0a199b4feb48a05913f4d101671 Mon Sep 17 00:00:00 2001 From: RizqiSyahrendra Date: Wed, 5 Feb 2025 17:49:33 +0700 Subject: [PATCH] fix: remove unused payload collections --- src/collections/consultations/Interests.ts | 17 ---- .../consultations/consultation-datetime.ts | 66 -------------- src/payload-types.ts | 89 +------------------ src/payload.config.ts | 7 +- 4 files changed, 4 insertions(+), 175 deletions(-) delete mode 100644 src/collections/consultations/Interests.ts delete mode 100644 src/collections/consultations/consultation-datetime.ts diff --git a/src/collections/consultations/Interests.ts b/src/collections/consultations/Interests.ts deleted file mode 100644 index df6ffc8..0000000 --- a/src/collections/consultations/Interests.ts +++ /dev/null @@ -1,17 +0,0 @@ -import type { CollectionConfig } from "payload"; - -export const Interests: CollectionConfig = { - slug: "interests", - fields: [ - { - name: "interest", - type: "text", - required: true, - }, - ], - admin: { - group: "Consultation", - description: "This is the procedure interests that can be selected when request a consultation", - hideAPIURL: true, - }, -}; diff --git a/src/collections/consultations/consultation-datetime.ts b/src/collections/consultations/consultation-datetime.ts deleted file mode 100644 index e4a20db..0000000 --- a/src/collections/consultations/consultation-datetime.ts +++ /dev/null @@ -1,66 +0,0 @@ -import type { GlobalConfig } from "payload"; - -export const ConsultationDateTime: GlobalConfig = { - slug: "consultation-datetime", - label: "Consultation Date & Time", - fields: [ - { - name: "day", - type: "group", - fields: [ - { - type: "checkbox", - name: "monday", - }, - { - type: "checkbox", - name: "tuesday", - }, - { - type: "checkbox", - name: "wednesday", - }, - { - type: "checkbox", - name: "thursday", - }, - { - type: "checkbox", - name: "friday", - }, - { - type: "checkbox", - name: "saturday", - }, - ], - }, - { - name: "time", - type: "array", - fields: [ - { - name: "name", - type: "text", - required: true, - }, - { - name: "start", - label: "Start Time", - type: "text", - required: true, - }, - { - name: "end", - label: "End Time", - type: "text", - required: true, - }, - ], - }, - ], - admin: { - group: "Consultation", - description: "Date and time available for consultation", - hideAPIURL: true, - }, -}; diff --git a/src/payload-types.ts b/src/payload-types.ts index 6469088..0d8ed6b 100644 --- a/src/payload-types.ts +++ b/src/payload-types.ts @@ -14,7 +14,6 @@ export interface Config { users: User; media: Media; blogs: Blog; - interests: Interest; forms: Form; 'form-submissions': FormSubmission; 'payload-locked-documents': PayloadLockedDocument; @@ -26,7 +25,6 @@ export interface Config { users: UsersSelect | UsersSelect; media: MediaSelect | MediaSelect; blogs: BlogsSelect | BlogsSelect; - interests: InterestsSelect | InterestsSelect; forms: FormsSelect | FormsSelect; 'form-submissions': FormSubmissionsSelect | FormSubmissionsSelect; 'payload-locked-documents': PayloadLockedDocumentsSelect | PayloadLockedDocumentsSelect; @@ -36,12 +34,8 @@ export interface Config { db: { defaultIDType: number; }; - globals: { - 'consultation-datetime': ConsultationDatetime; - }; - globalsSelect: { - 'consultation-datetime': ConsultationDatetimeSelect | ConsultationDatetimeSelect; - }; + globals: {}; + globalsSelect: {}; locale: null; user: User & { collection: 'users'; @@ -133,18 +127,6 @@ export interface Blog { updatedAt: string; createdAt: string; } -/** - * This is the procedure interests that can be selected when request a consultation - * - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "interests". - */ -export interface Interest { - id: number; - interest: string; - updatedAt: string; - createdAt: string; -} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "forms". @@ -334,10 +316,6 @@ export interface PayloadLockedDocument { relationTo: 'blogs'; value: number | Blog; } | null) - | ({ - relationTo: 'interests'; - value: number | Interest; - } | null) | ({ relationTo: 'forms'; value: number | Form; @@ -434,15 +412,6 @@ export interface BlogsSelect { updatedAt?: T; createdAt?: T; } -/** - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "interests_select". - */ -export interface InterestsSelect { - interest?: T; - updatedAt?: T; - createdAt?: T; -} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "forms_select". @@ -616,60 +585,6 @@ export interface PayloadMigrationsSelect { updatedAt?: T; createdAt?: T; } -/** - * Date and time available for consultation - * - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "consultation-datetime". - */ -export interface ConsultationDatetime { - id: number; - day?: { - monday?: boolean | null; - tuesday?: boolean | null; - wednesday?: boolean | null; - thursday?: boolean | null; - friday?: boolean | null; - saturday?: boolean | null; - }; - time?: - | { - name: string; - start: string; - end: string; - id?: string | null; - }[] - | null; - updatedAt?: string | null; - createdAt?: string | null; -} -/** - * This interface was referenced by `Config`'s JSON-Schema - * via the `definition` "consultation-datetime_select". - */ -export interface ConsultationDatetimeSelect { - day?: - | T - | { - monday?: T; - tuesday?: T; - wednesday?: T; - thursday?: T; - friday?: T; - saturday?: T; - }; - time?: - | T - | { - name?: T; - start?: T; - end?: T; - id?: T; - }; - updatedAt?: T; - createdAt?: T; - globalType?: T; -} /** * This interface was referenced by `Config`'s JSON-Schema * via the `definition` "auth". diff --git a/src/payload.config.ts b/src/payload.config.ts index def7f31..34ddb91 100644 --- a/src/payload.config.ts +++ b/src/payload.config.ts @@ -1,8 +1,8 @@ // storage-adapter-import-placeholder import { postgresAdapter } from "@payloadcms/db-postgres"; import { payloadCloudPlugin } from "@payloadcms/payload-cloud"; -import { s3Storage } from "@payloadcms/storage-s3"; import { formBuilderPlugin } from "@payloadcms/plugin-form-builder"; +import { s3Storage } from "@payloadcms/storage-s3"; import path from "path"; import { buildConfig } from "payload"; import sharp from "sharp"; @@ -11,8 +11,6 @@ import { fileURLToPath } from "url"; import { Blogs } from "@/collections/Blogs"; import { Media } from "@/collections/Media"; import { Users } from "@/collections/Users"; -import { Interests } from "@/collections/consultations/Interests"; -import { ConsultationDateTime } from "@/collections/consultations/consultation-datetime"; import { BoldFeature, FixedToolbarFeature, @@ -47,8 +45,7 @@ export default buildConfig({ }, theme: "dark", }, - collections: [Users, Media, Blogs, Interests], - globals: [ConsultationDateTime], + collections: [Users, Media, Blogs], secret: process.env.PAYLOAD_SECRET || "", typescript: { outputFile: path.resolve(dirname, "payload-types.ts"),