fix: conultation interests and datetime
This commit is contained in:
parent
8ec9dd5556
commit
845cbdb4e3
16
src/collections/consultations/Interests.ts
Normal file
16
src/collections/consultations/Interests.ts
Normal file
@ -0,0 +1,16 @@
|
||||
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",
|
||||
},
|
||||
};
|
63
src/collections/consultations/consultation-datetime.ts
Normal file
63
src/collections/consultations/consultation-datetime.ts
Normal file
@ -0,0 +1,63 @@
|
||||
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",
|
||||
type: "text",
|
||||
required: true,
|
||||
},
|
||||
{
|
||||
name: "end",
|
||||
type: "text",
|
||||
required: true,
|
||||
},
|
||||
],
|
||||
},
|
||||
],
|
||||
admin: {
|
||||
group: "Consultation",
|
||||
description: "Date and time available for consultation",
|
||||
},
|
||||
};
|
@ -10,6 +10,8 @@ import sharp from "sharp";
|
||||
import { Users } from "./collections/Users";
|
||||
import { Media } from "./collections/Media";
|
||||
import { Blogs } from "./collections/Blogs";
|
||||
import { Interests } from "./collections/consultations/Interests";
|
||||
import { ConsultationDateTime } from "./collections/consultations/consultation-datetime";
|
||||
|
||||
const filename = fileURLToPath(import.meta.url);
|
||||
const dirname = path.dirname(filename);
|
||||
@ -21,7 +23,8 @@ export default buildConfig({
|
||||
baseDir: path.resolve(dirname),
|
||||
},
|
||||
},
|
||||
collections: [Users, Media, Blogs],
|
||||
collections: [Users, Media, Blogs, Interests],
|
||||
globals: [ConsultationDateTime],
|
||||
secret: process.env.PAYLOAD_SECRET || "",
|
||||
typescript: {
|
||||
outputFile: path.resolve(dirname, "payload-types.ts"),
|
||||
|
Loading…
x
Reference in New Issue
Block a user