fix(file name wrong): fixed the name of the file for getCompanies
This commit is contained in:
17
frontend/src/lib/querys/forklifts/getCompanies.ts
Normal file
17
frontend/src/lib/querys/forklifts/getCompanies.ts
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
import { queryOptions } from "@tanstack/react-query";
|
||||||
|
import axios from "axios";
|
||||||
|
|
||||||
|
export function getCompanies() {
|
||||||
|
return queryOptions({
|
||||||
|
queryKey: ["getCompanies"],
|
||||||
|
queryFn: () => fetch(),
|
||||||
|
staleTime: 5000,
|
||||||
|
refetchOnWindowFocus: true,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const fetch = async () => {
|
||||||
|
const { data } = await axios.get("/lst/api/forklifts/companies");
|
||||||
|
|
||||||
|
return data.data;
|
||||||
|
};
|
||||||
@@ -9,7 +9,7 @@ import {
|
|||||||
DialogHeader,
|
DialogHeader,
|
||||||
DialogTitle,
|
DialogTitle,
|
||||||
} from "@/components/ui/dialog";
|
} from "@/components/ui/dialog";
|
||||||
import { getCompanies } from "@/lib/querys/forklifts/getModules";
|
import { getCompanies } from "@/lib/querys/forklifts/getCompanies";
|
||||||
import { useAppForm } from "../../../../lib/formStuff";
|
import { useAppForm } from "../../../../lib/formStuff";
|
||||||
|
|
||||||
export default function NewCompanyForm({
|
export default function NewCompanyForm({
|
||||||
|
|||||||
@@ -30,7 +30,7 @@ import {
|
|||||||
TableHeader,
|
TableHeader,
|
||||||
TableRow,
|
TableRow,
|
||||||
} from "@/components/ui/table";
|
} from "@/components/ui/table";
|
||||||
import { getCompanies } from "@/lib/querys/forklifts/getModules";
|
import { getCompanies } from "@/lib/querys/forklifts/getCompanies";
|
||||||
import { cn } from "@/lib/utils";
|
import { cn } from "@/lib/utils";
|
||||||
|
|
||||||
type Company = {
|
type Company = {
|
||||||
|
|||||||
Reference in New Issue
Block a user