thieu dau ngoac vuong lam gi cang

This commit is contained in:
2024-10-30 12:09:33 +07:00
parent 8631bd935d
commit 3114357515
3 changed files with 16 additions and 17 deletions

View File

@@ -95,15 +95,15 @@ export class AppConfigSchema extends PothosSchema {
type: [this.appConfig()], type: [this.appConfig()],
description: 'Create multiple app configs', description: 'Create multiple app configs',
args: { args: {
input: t.arg({ data: t.arg({
type: this.builder.generator.getCreateManyInput('Config'), type: [this.builder.generator.getCreateManyInput('Config')],
required: true, required: true,
}), }),
}, },
resolve: async (query, _root, args) => { resolve: async (query, _root, args) => {
return await this.prisma.config.createManyAndReturn({ return await this.prisma.config.createManyAndReturn({
...query, ...query,
data: args.input, data: args.data,
}) })
}, },
}), }),

File diff suppressed because one or more lines are too long

View File

@@ -4,20 +4,19 @@ import { Injectable } from '@nestjs/common'
import { PrismaService } from 'src/Prisma/prisma.service' import { PrismaService } from 'src/Prisma/prisma.service'
import { Schedule } from '@prisma/client' import { Schedule } from '@prisma/client'
import { AppConfigService } from 'src/AppConfig/appconfig.service'
@Injectable() @Injectable()
export class ScheduleService { export class ScheduleService {
constructor(private readonly prisma: PrismaService) {} constructor(
private readonly prisma: PrismaService,
private readonly appConfigService: AppConfigService,
) {}
// async createSchedule(schedule: Schedule) { async createSchedule(schedule: Schedule) {
// // generate Slot By config // get config
// const slots = await this.generateSlots(schedule.config); const config = await this.appConfigService.getVisibleConfigs()
// return this.prisma.schedule.createManyAndReturn({ console.log(config)
// data: schedule, // generate Slot By config
// }); }
// }
// async getSchedule(id: string) {
// return this.prisma.schedule.findUnique({
// where: { id },
// });
// }
} }