adding api unit tests (#108)

* adding api unit tests

* adding not signed in alerts to flights and logs
This commit was merged in pull request #108.
This commit is contained in:
2026-03-08 14:58:24 -05:00
committed by GitHub
parent b7e74242b8
commit 487afb08d6
40 changed files with 1621 additions and 182 deletions

View File

@@ -33,7 +33,7 @@ const LogForm = () => {
`api/logs/${logbookContext.state.selectedLogId}`
);
const log = response.data;
console.log(log)
reset(log);
} catch (error) {
const axiosError = error as AxiosError;
@@ -53,11 +53,16 @@ const LogForm = () => {
if (pilots && FormMode.ADD) {
const newPilotsOptions = pilots.map((pilot) => {
return {
key: pilot.id,
label: pilot.name,
value: pilot.id,
};
});
newPilotsOptions.unshift({
label: '',
value: '',
})
dispatch({ type: 'SET_PILOT_OPTIONS', payload: newPilotsOptions });
}
}, [pilots]);
@@ -80,9 +85,9 @@ const LogForm = () => {
onChange={onChange}
value={[value]}
>
{state.pilotOptions?.map((pilotOption: { key: string; label: string, }) => {
{state.pilotOptions?.map((pilotOption: { label: string, value: string; }) => {
return (
<option key={pilotOption.key}>{pilotOption.label}</option>
<option value={pilotOption.value}>{pilotOption.label}</option>
)
})}
</select>