UNPKG

test-iki-mini-app

Version:

ứng dựng bán hàng trên mini app z a l o

34 lines (32 loc) 900 B
import { callApi } from "../api/index.jsx"; import { constants as c } from "../constants"; const getAllAddress = () => { return callApi(`/customer/${c.STORE_CODE}/address`, "get"); } const addAddress = (form) => { return callApi(`/customer/${c.STORE_CODE}/address`, "post", form); }; const editAddress = (id, form) => { return callApi(`/customer/${c.STORE_CODE}/address/${id}`, "put", form); }; const deleteAddress = (id) => { return callApi(`/customer/${c.STORE_CODE}/address/${id}`, "delete"); }; const getProvinces = () => { return callApi('/place/vn/province', "get"); }; const getDistrict = (id) => { return callApi(`/place/vn/district/${id}`, "get"); }; const getWards = (id) => { return callApi(`/place/vn/wards/${id}`, "get"); }; export const address = { getProvinces, getDistrict, getWards, addAddress, getAllAddress, editAddress, deleteAddress };