thieu dau ngoac vuong lam gi cang
This commit is contained in:
@@ -95,15 +95,15 @@ export class AppConfigSchema extends PothosSchema {
|
||||
type: [this.appConfig()],
|
||||
description: 'Create multiple app configs',
|
||||
args: {
|
||||
input: t.arg({
|
||||
type: this.builder.generator.getCreateManyInput('Config'),
|
||||
data: t.arg({
|
||||
type: [this.builder.generator.getCreateManyInput('Config')],
|
||||
required: true,
|
||||
}),
|
||||
},
|
||||
resolve: async (query, _root, args) => {
|
||||
return await this.prisma.config.createManyAndReturn({
|
||||
...query,
|
||||
data: args.input,
|
||||
data: args.data,
|
||||
})
|
||||
},
|
||||
}),
|
||||
|
||||
File diff suppressed because one or more lines are too long
@@ -4,20 +4,19 @@ import { Injectable } from '@nestjs/common'
|
||||
import { PrismaService } from 'src/Prisma/prisma.service'
|
||||
import { Schedule } from '@prisma/client'
|
||||
|
||||
import { AppConfigService } from 'src/AppConfig/appconfig.service'
|
||||
|
||||
@Injectable()
|
||||
export class ScheduleService {
|
||||
constructor(private readonly prisma: PrismaService) {}
|
||||
constructor(
|
||||
private readonly prisma: PrismaService,
|
||||
private readonly appConfigService: AppConfigService,
|
||||
) {}
|
||||
|
||||
// async createSchedule(schedule: Schedule) {
|
||||
// // generate Slot By config
|
||||
// const slots = await this.generateSlots(schedule.config);
|
||||
// return this.prisma.schedule.createManyAndReturn({
|
||||
// data: schedule,
|
||||
// });
|
||||
// }
|
||||
// async getSchedule(id: string) {
|
||||
// return this.prisma.schedule.findUnique({
|
||||
// where: { id },
|
||||
// });
|
||||
// }
|
||||
async createSchedule(schedule: Schedule) {
|
||||
// get config
|
||||
const config = await this.appConfigService.getVisibleConfigs()
|
||||
console.log(config)
|
||||
// generate Slot By config
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user