Untitled
unknown
tsx
3 years ago
807 B
12
Indexable
axios.defaults.baseURL = 'https://rebox.ir';
const api = {
get: axios.get,
post: axios.post,
};
// --------------------
import api from '@/services/apiServcie';
import { BuyRecordOrderType } from '@/types/routes/profile/global/buyRecordOrder.type';
import { AxiosResponse } from 'axios';
type AxiosResponseType = BuyRecordOrderType[];
export const APIfetchBuyRecordOrders = async (args: {
token: string | undefined;
phoneNumber: string;
}): Promise<AxiosResponseType> => {
const { data }: AxiosResponse<AxiosResponseType> = await api.post(
'/purchaseOrders',
{ customerid: args.phoneNumber, sell: 1 },
{
headers: {
'Content-Type': 'application/json',
Authorization: `Bearer ${args.token}`,
},
},
);
return data;
};Editor is loading...