fix : wip

This commit is contained in:
2026-02-19 17:44:37 +01:00
parent c2e118dc33
commit 13274ff297
31 changed files with 1539 additions and 126 deletions

View File

@@ -1,4 +1,5 @@
import type {
WorkHourDayContext,
WorkHour,
WorkHourEntryPayload,
WeeklyWorkHourSummary
@@ -39,12 +40,17 @@ export const bulkUpsertWorkHours = async (payload: {
)
}
export const updateWorkHourValidation = async (id: number, isValid: boolean) => {
export const updateWorkHourValidation = async (
id: number,
isValid: boolean,
options?: { toast?: boolean }
) => {
const api = useApi()
return api.patch<WorkHour>(
`/work_hours/${id}`,
{ isValid },
{
toast: options?.toast ?? true,
toastSuccessMessage: isValid ? 'Ligne validée.' : 'Validation retirée.',
toastErrorMessage: 'Impossible de mettre à jour la validation.'
}
@@ -59,3 +65,12 @@ export const getWeeklyWorkHourSummary = async (weekStart: string) => {
{ toast: false }
)
}
export const getWorkHourDayContext = async (workDate: string) => {
const api = useApi()
return api.get<WorkHourDayContext>(
'/work-hours/day-context',
{ workDate },
{ toast: false }
)
}