Implement flight updating

This commit is contained in:
april
2024-01-05 15:41:47 -06:00
parent dcb6ce3c2a
commit 4a0e49a959
5 changed files with 113 additions and 4 deletions

View File

@@ -135,7 +135,34 @@ const flightCreateHelper = (
}
};
const flightEditHelper = (
values: FlightCreateSchema
): FlightFormSchema | void => {
try {
const flight = {
...values,
date: dayjs(values.date),
time_start: Number(
`${dayjs(values.time_start).hour()}${dayjs(values.time_start).minute()}`
),
time_off: Number(
`${dayjs(values.time_off).hour()}${dayjs(values.time_off).minute()}`
),
time_down: Number(
`${dayjs(values.time_down).hour()}${dayjs(values.time_down).minute()}`
),
time_stop: Number(
`${dayjs(values.time_stop).hour()}${dayjs(values.time_stop).minute()}`
),
};
return flight;
} catch (err) {
console.log(err);
}
};
export {
flightEditHelper,
flightCreateHelper,
type FlightFormSchema,
type FlightCreateSchema,