implement admin panel with login functionality and dashboard layout

This commit is contained in:
2025-08-31 18:07:49 +02:00
parent 8fb70ccccd
commit 217803ba8f
16 changed files with 409 additions and 2 deletions

View File

@@ -319,3 +319,12 @@ export const onReturn = async (loanId) => {
}
return { success: false };
};
export const loginAdmin = async (username, password) => {
const [result] = await pool.query(
"SELECT * FROM admins WHERE username = ? AND password = ?",
[username, password]
);
if (result.length > 0) return { success: true, data: result[0] };
return { success: false };
};