Some checks failed
Auto Tag Develop / tag (push) Has been cancelled
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [x] Pas de régression - [x] TU/TI/TF rédigée - [x] TU/TI/TF OK - [x] CHANGELOG modifié Reviewed-on: #19 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
28 lines
1.0 KiB
TypeScript
28 lines
1.0 KiB
TypeScript
import type { EmployeeLeaveSummary } from './dto/employee-leave-summary'
|
|
|
|
export const getEmployeeLeaveSummary = async (employeeId: number, year?: number, phaseId?: number) => {
|
|
const api = useApi()
|
|
const query: Record<string, string> = {}
|
|
if (year) query.year = String(year)
|
|
if (phaseId !== undefined) query.phaseId = String(phaseId)
|
|
|
|
return api.get<EmployeeLeaveSummary>(`/employees/${employeeId}/leave-summary`, query, { toast: false })
|
|
}
|
|
|
|
export const updateFractionedDays = async (employeeId: number, fractionedDays: number, year?: number) => {
|
|
const api = useApi()
|
|
const body: Record<string, unknown> = { fractionedDays }
|
|
if (year) body.year = year
|
|
|
|
return api.patch(`/employees/${employeeId}/fractioned-days`, body)
|
|
}
|
|
|
|
export const updatePaidLeaveDays = async (employeeId: number, paidLeaveDays: number, year?: number) => {
|
|
const api = useApi()
|
|
const body: Record<string, unknown> = { paidLeaveDays }
|
|
if (year) body.year = year
|
|
|
|
return api.patch(`/employees/${employeeId}/paid-leave-days`, body)
|
|
}
|
|
|