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