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:
2025-01-16 19:38:25 +07:00
parent a90811af86
commit c2d3ebba09

View File

@@ -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,
},