All checks were successful
Auto Tag Develop / tag (push) Successful in 7s
| Numéro du ticket | Titre du ticket | |------------------|-----------------| | | | ## Description de la PR ## Modification du .env ## Check list - [ ] Pas de régression - [ ] TU/TI/TF rédigée - [ ] TU/TI/TF OK - [ ] CHANGELOG modifié Reviewed-on: #12 Co-authored-by: tristan <tristan@yuno.malio.fr> Co-committed-by: tristan <tristan@yuno.malio.fr>
27 lines
953 B
TypeScript
27 lines
953 B
TypeScript
import type { EmployeeLeaveSummary } from './dto/employee-leave-summary'
|
|
|
|
export const getEmployeeLeaveSummary = async (employeeId: number, year?: number) => {
|
|
const api = useApi()
|
|
const query: Record<string, string> = {}
|
|
if (year) query.year = String(year)
|
|
|
|
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)
|
|
}
|
|
|