fix: update serviceAndCategory update query structure
- Modified the update query in ServiceAndCategorySchema to use a composite key for the `where` clause, ensuring that both `serviceId` and `subCategoryId` are correctly utilized for identifying records. - This change enhances the accuracy of the update operation, improving data integrity and consistency within the service and category management functionality.
This commit is contained in:
@@ -94,7 +94,12 @@ export class ServiceAndCategorySchema extends PothosSchema {
|
||||
resolve: async (query, _root, args, _ctx, _info) => {
|
||||
return await this.prisma.serviceAndCategory.update({
|
||||
...query,
|
||||
where: args.where,
|
||||
where: {
|
||||
serviceId_subCategoryId: {
|
||||
serviceId: args.where.serviceId as string,
|
||||
subCategoryId: args.where.subCategoryId as string,
|
||||
},
|
||||
},
|
||||
data: {
|
||||
isDeleted: true,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user