Merge branch 'main' into devcontainers
This commit is contained in:
@@ -69,7 +69,7 @@ export async function getUserActiveLOA(userId: number): Promise<LOARequest[]> {
|
|||||||
FROM leave_of_absences
|
FROM leave_of_absences
|
||||||
WHERE member_id = ?
|
WHERE member_id = ?
|
||||||
AND closed IS NULL
|
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]);
|
const LOAData = await pool.query(sql, [userId]);
|
||||||
return LOAData;
|
return LOAData;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -36,8 +36,12 @@ const version = import.meta.env.VITE_APPLICATION_VERSION;
|
|||||||
</Alert>
|
</Alert>
|
||||||
<Alert v-if="userStore.user?.LOAs?.[0]" class="m-2 mx-auto max-w-5xl" variant="info">
|
<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">
|
<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 ||
|
<p v-if="new Date(userStore.user?.LOAs?.[0].extended_till || userStore.user?.LOAs?.[0].end_date) > new Date()">
|
||||||
userStore.user?.LOAs?.[0].end_date) }}</strong></p>
|
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"
|
<Button variant="secondary"
|
||||||
@click="async () => { await cancelLOA(userStore.user.LOAs?.[0].id); userStore.loadUser(); }">End
|
@click="async () => { await cancelLOA(userStore.user.LOAs?.[0].id); userStore.loadUser(); }">End
|
||||||
LOA</Button>
|
LOA</Button>
|
||||||
|
|||||||
Reference in New Issue
Block a user