Skip to content

Commit

Permalink
projectVerificationRepository.ts replace .save with update method
Browse files Browse the repository at this point in the history
  • Loading branch information
RamRamez committed Jun 19, 2024
1 parent 179c92b commit da168df
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions src/repositories/projectVerificationRepository.ts
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,10 @@ export const updateProjectPersonalInfoOfProjectVerification = async (params: {
}

projectVerificationForm.personalInfo = personalInfo;
return projectVerificationForm?.save();
await ProjectVerificationForm.update(projectVerificationId, {
personalInfo,
});
return projectVerificationForm;
} catch (error) {
logger.debug(
'updateProjectPersonalInfoOfProjectVerification error: ',
Expand Down Expand Up @@ -226,9 +229,11 @@ export const updateProjectVerificationStatus = async (params: {
i18n.__(translationErrorMessagesKeys.PROJECT_VERIFICATION_FORM_NOT_FOUND),
);
}

await ProjectVerificationForm.update(projectVerificationId, {
status,
});
projectVerificationForm.status = status;
return projectVerificationForm?.save();
return projectVerificationForm;
};

export const updateProjectVerificationLastStep = async (params: {
Expand All @@ -244,9 +249,11 @@ export const updateProjectVerificationLastStep = async (params: {
i18n.__(translationErrorMessagesKeys.PROJECT_VERIFICATION_FORM_NOT_FOUND),
);
}

await ProjectVerificationForm.update(projectVerificationId, {
lastStep,
});
projectVerificationForm.lastStep = lastStep;
return projectVerificationForm?.save();
return projectVerificationForm;
};

export const updateProjectContactsOfProjectVerification = async (params: {
Expand Down

0 comments on commit da168df

Please sign in to comment.