import request from 'libs/request'

export function fetchStoreList (params) {
  const defaultParams = {
    keyword: params.searchKey || '',
    page_size: 10,
    page_num: 1
  }
  return request.get('store/queryList', {params: Object.assign(defaultParams, params)})
}

export function createStore (data) {
  return request.post('store/add', data)
}

export function updateStore (data) {
  return request.post('store/update', data)
}

export function fetchAllStore (params) {
  return request.get('store/all', {params})
}

export function deleteStore (intIds) {
  return request.post('store/delete', { intIds })
}