Skip to content

Commit

Permalink
Resolve issue soft deleting submissions and enquiries
Browse files Browse the repository at this point in the history
  • Loading branch information
kyle1morel committed Sep 19, 2024
1 parent 835c390 commit 5fa3647
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 8 deletions.
6 changes: 2 additions & 4 deletions app/src/services/enquiry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -179,14 +179,12 @@ const service = {
updateIsDeletedFlag: async (enquiryId: string, isDeleted: boolean, updateStamp: Partial<IStamps>) => {
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
}
Expand Down
7 changes: 3 additions & 4 deletions app/src/services/submission.ts
Original file line number Diff line number Diff line change
Expand Up @@ -266,14 +266,13 @@ const service = {
updateIsDeletedFlag: async (submissionId: string, isDeleted: boolean, updateStamp: Partial<IStamps>) => {
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
}
Expand Down

0 comments on commit 5fa3647

Please sign in to comment.