feat: search working as expected

This commit is contained in:
Daniel Avila 2023-03-18 17:49:24 -04:00
parent da42d6272a
commit 4197a92609
5 changed files with 60 additions and 51 deletions

View file

@ -13,6 +13,13 @@ const postRequest = async (url, { arg }) => {
return await axios.post(url, { withCredentials: true, arg });
};
export const searchFetcher = async (pre, q, pageNumber, callback) => {
pre();
const { data } = await axios.get(`/api/search?q=${q}&pageNumber=${pageNumber}`);
console.log('search data', data);
callback(data);
};
export const swr = (path, successCallback, options) => {
const _options = { ...options };