import request from '@/axios'
import { REQUEST_BASE } from '@/constants'

export const getStoreList = (params: any): Promise<IResponse> => {
  return request.get({ url: `${REQUEST_BASE}/store`, params })
}

export const addStore = (data: any): Promise<IResponse> => {
  return request.post({ url: `${REQUEST_BASE}/store`, data })
}

export const editStore = (data: any): Promise<IResponse> => {
  return request.put({ url: `${REQUEST_BASE}/store/${data.id}`, data })
}

export const delStore = (id: number): Promise<IResponse> => {
  return request.delete({ url: `${REQUEST_BASE}/store/${id}` })
}

export const getStoreDetail = (id: number): Promise<IResponse> => {
  return request.get({ url: `${REQUEST_BASE}/store/${id}` })
}
