added feature: That no loan can be deleted and edited changelog accordingly

This commit is contained in:
2026-04-26 19:35:48 +02:00
parent c61a283127
commit 5191871681
3 changed files with 8 additions and 3 deletions
@@ -17,7 +17,10 @@ export const getAllLoans = async () => {
};
export const deleteLoanById = async (loanId) => {
const [result] = await pool.query("DELETE FROM loans WHERE id = ?", [loanId]);
const [result] = await pool.query(
"UPDATE loans SET deleted = true, deleted_admin = true WHERE id = ?",
[loanId],
);
if (result.affectedRows > 0) return { success: true };
return { success: false };
};