fixed issue/bug: #7
This commit is contained in:
@@ -87,11 +87,8 @@ export const getItemsFromDatabase = async (role) => {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const getLoansFromDatabase = async () => {
|
export const getLoansFromDatabase = async () => {
|
||||||
const [result] = await pool.query("SELECT * FROM loans;");
|
const [rows] = await pool.query("SELECT * FROM loans;");
|
||||||
if (result.length > 0) {
|
return { success: true, data: rows.length > 0 ? rows : null };
|
||||||
return { success: true, data: result };
|
|
||||||
}
|
|
||||||
return { success: false };
|
|
||||||
};
|
};
|
||||||
|
|
||||||
export const getUserLoansFromDatabase = async (username) => {
|
export const getUserLoansFromDatabase = async (username) => {
|
||||||
|
Reference in New Issue
Block a user