import useAxios from '@core/utils/useAxios' import type { AddId, Customer } from '@/model/customer' import type { TableInput } from '@core/type/baseTable' import type {CheckCardRequest, CheckCardResponse} from "@/model/user"; export const createCustomer = async (obj: Customer) => await useAxios.post(`/admin/customer`, obj) export const deleteCustomer = async (id: number) => await useAxios.delete(`/admin/customer/${id}`) export const updateCustomer = async (id: number, obj: Customer) => await useAxios.put(`/admin/customer/${id}`, obj) export const getCustomerTable = async (params: TableInput) => await useAxios.post>('/admin/customer/table', params) export const getCustomersList = async () => await useAxios.get(`/admin/customer/list`) export const changeCustomerActivation = async (id: number) => await useAxios.get(`/admin/customer/active/${id}`) export const changeCustomerOrderActivation = async (id: number) => await useAxios.get(`/admin/customer/trade/${id}`) export const changeCustomerArchive = async (id: number) => await useAxios.get(`/admin/customer/archive/${id}`) export const confirmUser = async (id: number) => await useAxios.get(`/admin/customer/is_valid/${id}`) export const getCustomerArchiveTable = async (params: TableInput) => await useAxios.post>('/admin/customer/archive/table', params) export const getSingleTable = async (params: TableInput) => await useAxios.post>('/admin/customer/single/table', params) export const getSingleArchiveTable = async (params: TableInput) => await useAxios.post>('/admin/customer/single/archive/table', params) export const checkCard = async (data: CheckCardRequest) => { return await useAxios.post('/admin/check_card', data) }