invoice otp

This commit is contained in:
hamid zarghami
2025-02-24 14:42:37 +03:30
parent e5d321e041
commit 24a5461d2a
3 changed files with 99 additions and 17 deletions
+11 -4
View File
@@ -1,4 +1,8 @@
import axios from "../../../config/axios";
import {
ApproveInvoiceType,
RequestApproveInvoiceType,
} from "../types/ReceiptTypes";
export const getInvoice = async (status: string) => {
const { data } = await axios.get(`/invoices/user?status=${status}`);
@@ -10,13 +14,16 @@ export const getInvoiceDetail = async (id: string) => {
return data;
};
export const requestApprove = async (id: string) => {
const { data } = await axios.patch(`/invoices/${id}/approve/request`);
export const requestApprove = async (params: RequestApproveInvoiceType) => {
const { data } = await axios.post(
`/invoices/${params.id}/approve/request`,
params
);
return data;
};
export const approveInvoice = async (id: string) => {
const { data } = await axios.patch(`/invoices/${id}/approve`);
export const approveInvoice = async (params: ApproveInvoiceType) => {
const { data } = await axios.patch(`/invoices/${params.id}/approve`, params);
return data;
};