import qs from "query-string"

const ins = {
  post: (url, body, config = {}) => {
    const {params: query} = config
    return fetch(qs.stringifyUrl({url, query}), {...config, method: "POST", body})
  },
  get: (url, config) => fetch(qs.stringifyUrl({url, query: config.params}), {...config, method: "GET"}),
}
export default ins
