fix time geneate logic and replace default datetime by luxon
This commit is contained in:
@@ -23,6 +23,16 @@ export type ScheduleConfigType =
|
||||
| null
|
||||
| undefined
|
||||
|
||||
export type ScheduleConfigTypeForCenter =
|
||||
| {
|
||||
startDate?: string | null | undefined
|
||||
endDate?: string | null | undefined
|
||||
slots?: number[] | null | undefined
|
||||
days?: number[] | null | undefined
|
||||
}
|
||||
| null
|
||||
| undefined
|
||||
|
||||
export type ScheduleSlotType = {
|
||||
slot: string
|
||||
start: string
|
||||
@@ -144,6 +154,18 @@ export class ScheduleSchema extends PothosSchema {
|
||||
})
|
||||
}
|
||||
|
||||
@PothosRef()
|
||||
scheduleConfigInputForCenter() {
|
||||
return this.builder.inputType('ScheduleConfigInputForCenter', {
|
||||
fields: (t) => ({
|
||||
startDate: t.string(),
|
||||
endDate: t.string(),
|
||||
slots: t.intList(),
|
||||
days: t.intList(),
|
||||
}),
|
||||
})
|
||||
}
|
||||
|
||||
@Pothos()
|
||||
init(): void {
|
||||
this.builder.queryFields((t) => ({
|
||||
@@ -175,6 +197,21 @@ export class ScheduleSchema extends PothosSchema {
|
||||
},
|
||||
}),
|
||||
|
||||
// centerPreviewSchedule: t.field({
|
||||
// type: this.previewSchedule(),
|
||||
// description: 'Preview a schedule for center mentor.',
|
||||
// args: {
|
||||
// scheduleConfig: t.arg({
|
||||
// type: this.scheduleConfigInputForCenter(),
|
||||
// }),
|
||||
// },
|
||||
// resolve: async (_parent, args, _context, _info) => {
|
||||
// return await this.scheduleService.createSchedulePreviewForCenter(
|
||||
// args.scheduleConfig,
|
||||
// )
|
||||
// },
|
||||
// }),
|
||||
|
||||
adminPreviewSchedule: t.field({
|
||||
type: this.previewSchedule(),
|
||||
description: 'Preview a schedule for admin.',
|
||||
|
||||
Reference in New Issue
Block a user