added feature: That no loan can be deleted and edited changelog accordingly
This commit is contained in:
@@ -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 };
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user