migros-api-wrapper
Version:
Making the api of migros more accessible to the public.
27 lines • 969 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.searchStores = void 0;
const requests_1 = require("../../utils/requests");
const apiPaths_1 = require("../apiPaths");
const url = apiPaths_1.migrosApiPaths.store.public.v1 + "/search";
const defaultSearchStoresOptions = {
query: "",
};
async function getSearchStoresRequest(url, options, headers) {
url += `?query=${options.query}`;
const necessaryHeaders = {
accept: "application/json, text/plain, */*",
...headers,
};
const response = await (0, requests_1.getRequestBypass)(url, {}, necessaryHeaders);
return response.data;
}
async function searchStores(searchStoresOptions, headers) {
searchStoresOptions = {
...defaultSearchStoresOptions,
...searchStoresOptions,
};
return getSearchStoresRequest(url, searchStoresOptions, headers);
}
exports.searchStores = searchStores;
//# sourceMappingURL=search-stores.js.map