You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

45 lines
918 B

2 months ago
import apiService from "./apiClient";
export interface Address {
items: AddressItem[];
}
export interface AddressItem {
receiver_first_name: string;
receiver_last_name: string;
country: string;
receiver_phone: string;
whatsapp_phone: string;
province: string;
city: string;
district: string;
detail_address: string;
is_default: 0;
address_id: 0;
user_id: 0;
create_time: string;
update_time: string;
}
export interface addressData {
receiver_first_name: string;
receiver_last_name: string;
country: string;
receiver_phone: string;
whatsapp_phone: string;
province: string;
city: string;
district: string;
detail_address: string;
is_default: number;
}
export const addressApi = {
getAddress: () => {
return apiService.get<Address>("/api/addresses");
},
postAddress: (data: addressData) => {
return apiService.post("/api/addresses", { data });
},
};