fix: Fix issue/ticket #17
This commit is contained in:
@@ -12,7 +12,7 @@ const pool = mysql
|
|||||||
.promise();
|
.promise();
|
||||||
|
|
||||||
export const getAllLoans = async () => {
|
export const getAllLoans = async () => {
|
||||||
const [rows] = await pool.query("SELECT * FROM loans");
|
const [rows] = await pool.query("SELECT * FROM loans WHERE deleted_admin = 0;");
|
||||||
return { success: true, data: rows };
|
return { success: true, data: rows };
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -119,14 +119,6 @@ export const setTakeDateV2 = async (loanCode) => {
|
|||||||
return { message: "Failed to set take date", success: false };
|
return { message: "Failed to set take date", success: false };
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getAllLoansV2 = async () => {
|
|
||||||
const [result] = await pool.query("SELECT * FROM loans;");
|
|
||||||
if (result.length > 0) {
|
|
||||||
return { success: true, data: result };
|
|
||||||
}
|
|
||||||
return { success: false };
|
|
||||||
};
|
|
||||||
|
|
||||||
export const openDoor = async (doorKey) => {
|
export const openDoor = async (doorKey) => {
|
||||||
const [result] = await pool.query(
|
const [result] = await pool.query(
|
||||||
"SELECT safe_nr, id FROM items WHERE door_key = ?;",
|
"SELECT safe_nr, id FROM items WHERE door_key = ?;",
|
||||||
|
|||||||
Reference in New Issue
Block a user