fix approve resume

This commit is contained in:
2024-10-31 19:17:59 +07:00
parent 33190ecfa4
commit 24a49d9412
2 changed files with 56 additions and 12 deletions

View File

@@ -107,6 +107,49 @@ export class AppConfigSchema extends PothosSchema {
})
},
}),
updateAppConfig: t.prismaField({
type: this.appConfig(),
description: 'Update an app config',
args: {
input: t.arg({
type: this.builder.generator.getUpdateInput('Config'),
required: true,
}),
where: t.arg({
type: this.builder.generator.getWhereUnique('Config'),
required: true,
}),
},
resolve: async (query, _root, args) => {
return await this.prisma.config.update({
...query,
data: args.input,
where: args.where ?? undefined,
})
},
}),
/* The `updateAppConfigs` field in the `AppConfigSchema` class is defining a mutation to update
multiple app configs in the database. Here is a breakdown of what it is doing: */
// updateAppConfigs: t.prismaField({
// type: [this.appConfig()],
// description: 'Update multiple app configs',
// args: {
// data: t.arg({
// type: [this.builder.generator.getUpdateInput('Config')],
// required: true,
// }),
// where: t.arg({
// type: this.builder.generator.getWhere('Config'),
// required: true,
// }),
// },
// resolve: async (query, _root, args) => {
// return await this.prisma.config.updateMany({
// data: args.data,
// where: args.where ?? undefined,
// })
// },
// }),
}))
}
}