update invoice

This commit is contained in:
hamid zarghami
2026-02-21 14:28:32 +03:30
parent 002e45de0b
commit f2ebdc9836
8 changed files with 384 additions and 11 deletions
+16 -1
View File
@@ -1,5 +1,10 @@
import axios from "@/config/axios";
import type { CreatePreInvoiceType, GetInvoiceResponseType } from "../types/Types";
import type {
CreatePreInvoiceType,
GetInvoiceResponseType,
InvoiceType,
UpdatePreInvoiceType,
} from "../types/Types";
export const createInvoice = async (params: CreatePreInvoiceType) => {
const { data } = await axios.post("/admin/invoice", params);
@@ -12,3 +17,13 @@ export const getInvoice = async (page = 1): Promise<GetInvoiceResponseType> => {
});
return data;
};
export const getInvoiceById = async (id: string) => {
const { data } = await axios.get<{ data: InvoiceType }>(`/admin/invoice/${id}`);
return data;
};
export const updateInvoice = async (id: string, params: UpdatePreInvoiceType) => {
const { data } = await axios.patch(`/admin/invoice/${id}`, params);
return data;
};