add nodemailer integration for loan email notifications and implement loan info retrieval

This commit is contained in:
2025-10-02 22:32:26 +02:00
parent 04453fd885
commit af7d15c97a
5 changed files with 184 additions and 3 deletions

View File

@@ -182,6 +182,16 @@ export const getBorrowableItemsFromDatabase = async (
return { success: false };
};
export const getLoanInfoWithID = async (loanId) => {
const [rows] = await pool.query("SELECT * FROM loans WHERE id = ?;", [
loanId,
]);
if (rows.length > 0) {
return { success: true, data: rows[0] };
}
return { success: false };
};
export const createLoanInDatabase = async (
username,
startDate,