32 lines
764 B
JavaScript
32 lines
764 B
JavaScript
import { get, post } from '../request'
|
|
|
|
const prefix = 'address/'
|
|
|
|
export const getAddressListApi = async () => {
|
|
return await get(`${prefix}list`)
|
|
}
|
|
|
|
export const getDefaultAddressApi = async () => {
|
|
return await get(`${prefix}default-one`)
|
|
}
|
|
|
|
export const getAddressDetailApi = async (id) => {
|
|
return await get(`${prefix}detail`, { id })
|
|
}
|
|
|
|
export const createAddressApi = async (params) => {
|
|
return await post(`${prefix}create`, params)
|
|
}
|
|
|
|
export const updateAddressApi = async (params) => {
|
|
return await post(`${prefix}update`, params)
|
|
}
|
|
|
|
export const deleteAddressApi = async (id) => {
|
|
return await post(`${prefix}delete`, { ids: [id] })
|
|
}
|
|
|
|
export const setDefaultAddressApi = async (id) => {
|
|
return await post(`${prefix}set-default`, { id })
|
|
}
|