Merge pull request '#177-Overdue-LOA-not-showing' (#178) from #177-Overdue-LOA-not-showing into main
All checks were successful
Continuous Integration / Update Development (push) Successful in 3m17s

Reviewed-on: #178
This commit was merged in pull request #178.
This commit is contained in:
2026-02-01 23:34:59 -06:00
2 changed files with 7 additions and 3 deletions

View File

@@ -69,7 +69,7 @@ export async function getUserActiveLOA(userId: number): Promise<LOARequest[]> {
FROM leave_of_absences
WHERE member_id = ?
AND closed IS NULL
AND UTC_TIMESTAMP() BETWEEN start_date AND end_date;`
AND UTC_TIMESTAMP() > start_date;`
const LOAData = await pool.query(sql, [userId]);
return LOAData;
}

View File

@@ -36,8 +36,12 @@ const version = import.meta.env.VITE_APPLICATION_VERSION;
</Alert>
<Alert v-if="userStore.user?.LOAs?.[0]" class="m-2 mx-auto max-w-5xl" variant="info">
<AlertDescription class="flex flex-row items-center text-nowrap gap-5 mx-auto">
<p>You are on LOA until <strong>{{ formatDate(userStore.user?.LOAs?.[0].extended_till ||
userStore.user?.LOAs?.[0].end_date) }}</strong></p>
<p v-if="new Date(userStore.user?.LOAs?.[0].extended_till || userStore.user?.LOAs?.[0].end_date) > new Date()" class="text-yellow-600">
LOA until <strong>{{ formatDate(userStore.user?.LOAs?.[0].extended_till || userStore.user?.LOAs?.[0].end_date) }}</strong>
</p>
<p v-else>
LOA expired on <strong>{{ formatDate(userStore.user?.LOAs?.[0].extended_till || userStore.user?.LOAs?.[0].end_date) }}</strong>
</p>
<Button variant="secondary"
@click="async () => { await cancelLOA(userStore.user.LOAs?.[0].id); userStore.loadUser(); }">End
LOA</Button>