account-claim #98

Merged
Ajdj100 merged 7 commits from account-claim into main 2025-12-14 21:52:23 -06:00
Showing only changes of commit 7ac83b532b - Show all commits

View File

@@ -38,18 +38,11 @@ router.get('/me', [requireLogin], async (req, res) => {
try {
const { id, name, state } = await getUserData(req.user.id);
// const LOAData = await pool.query(
// `SELECT *
// FROM leave_of_absences
// WHERE member_id = ?
// AND deleted = 0
// AND UTC_TIMESTAMP() BETWEEN start_date AND end_date;`, req.user.id);
const LOAData = await getUserActiveLOA(req.user.id);
const roleData = await getUserRoles(req.user.id);
const userDataFull = { id, name, state, LOAData, roleData };
console.log(userDataFull)
res.status(200).json(userDataFull);
} catch (error) {
console.error('Error fetching user data:', error);