feat(invoice form): added new invoice form
This commit is contained in:
@@ -13,6 +13,7 @@ import { FieldErrors } from "./FieldErrors";
|
||||
|
||||
type DateFieldProps = {
|
||||
label: string;
|
||||
required: boolean;
|
||||
};
|
||||
export const DateField = ({ label }: DateFieldProps) => {
|
||||
const field = useFieldContext<any>();
|
||||
@@ -37,6 +38,7 @@ export const DateField = ({ label }: DateFieldProps) => {
|
||||
<Calendar
|
||||
mode="single"
|
||||
selected={date}
|
||||
//required={required}
|
||||
captionLayout="dropdown"
|
||||
startMonth={new Date(new Date().getFullYear() - 10, 0)}
|
||||
endMonth={new Date(new Date().getFullYear() + 20, 0)}
|
||||
|
||||
17
frontend/src/lib/querys/forklifts/getInvoices.ts
Normal file
17
frontend/src/lib/querys/forklifts/getInvoices.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import { queryOptions } from "@tanstack/react-query";
|
||||
import axios from "axios";
|
||||
|
||||
export function getInvoices() {
|
||||
return queryOptions({
|
||||
queryKey: ["getInvoices"],
|
||||
queryFn: () => fetch(),
|
||||
staleTime: 5000,
|
||||
refetchOnWindowFocus: true,
|
||||
});
|
||||
}
|
||||
|
||||
const fetch = async () => {
|
||||
const { data } = await axios.get("/lst/api/forklifts/invoices");
|
||||
|
||||
return data.data;
|
||||
};
|
||||
Reference in New Issue
Block a user