update invoice
This commit is contained in:
@@ -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;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user