Implement aircraft values in flight creation/updating

This commit is contained in:
april
2024-01-11 11:30:10 -06:00
parent d6d03c9027
commit b50d333677
7 changed files with 449 additions and 215 deletions

13
web/app/util/hooks.ts Normal file
View File

@@ -0,0 +1,13 @@
import { useQuery } from "@tanstack/react-query";
import { useApi } from "./api";
export function useAircraft() {
const client = useApi();
const aircraft = useQuery({
queryKey: ["aircraft-list"],
queryFn: async () => await client.get(`/aircraft`).then((res) => res.data),
});
return aircraft;
}