diff --git a/app/src/services/enquiry.ts b/app/src/services/enquiry.ts index fd40d782..35139b6a 100644 --- a/app/src/services/enquiry.ts +++ b/app/src/services/enquiry.ts @@ -179,14 +179,12 @@ const service = { updateIsDeletedFlag: async (enquiryId: string, isDeleted: boolean, updateStamp: Partial) => { const deleteEnquiry = await prisma.enquiry.findUnique({ where: { - enquiry_id: enquiryId, - updated_at: updateStamp.updatedAt, - updated_by: updateStamp.updatedBy + enquiry_id: enquiryId } }); if (deleteEnquiry) { await prisma.activity.update({ - data: { is_deleted: isDeleted }, + data: { is_deleted: isDeleted, updated_at: updateStamp.updatedAt, updated_by: updateStamp.updatedBy }, where: { activity_id: deleteEnquiry.activity_id } diff --git a/app/src/services/submission.ts b/app/src/services/submission.ts index afff691e..04758ff2 100644 --- a/app/src/services/submission.ts +++ b/app/src/services/submission.ts @@ -266,14 +266,13 @@ const service = { updateIsDeletedFlag: async (submissionId: string, isDeleted: boolean, updateStamp: Partial) => { const deleteSubmission = await prisma.submission.findUnique({ where: { - submission_id: submissionId, - updated_at: updateStamp.updatedAt, - updated_by: updateStamp.updatedBy + submission_id: submissionId } }); + if (deleteSubmission) { await prisma.activity.update({ - data: { is_deleted: isDeleted }, + data: { is_deleted: isDeleted, updated_at: updateStamp.updatedAt, updated_by: updateStamp.updatedBy }, where: { activity_id: deleteSubmission?.activity_id }