Get Recipes Route Rewrite (#339)

* deprecate old route

* auto-gen

* recipe card infinite scroll

* fix datatable

* set hard-limit option

* add loader

* set scroll on navigation

* add auto-import

* fix slow initial load

* remove console.logs

Co-authored-by: hay-kot <hay-kot@pm.me>
This commit is contained in:
Hayden
2021-04-22 22:13:55 -08:00
committed by GitHub
parent 80f8806604
commit 8e4b951ecc
19 changed files with 128 additions and 73 deletions

View File

@@ -2,7 +2,6 @@ import { baseURL } from "./api-utils";
import { apiReq } from "./api-utils";
import { store } from "../store";
import { router } from "../main";
import qs from "qs";
const prefix = baseURL + "recipes/";
@@ -78,22 +77,10 @@ export const recipeAPI = {
router.push(`/`);
},
async allByKeys(recipeKeys, num = 9999) {
const response = await apiReq.get(recipeURLs.allRecipes, {
params: {
keys: recipeKeys,
num: num,
},
paramsSerializer: params => {
return qs.stringify(params, { arrayFormat: "repeat" });
},
async allSummary(start = 0, limit = 9999) {
const response = await apiReq.get(recipeURLs.summary, {
params: { start: start, limit: limit },
});
return response.data;
},
async allSummary() {
const response = await apiReq.get(recipeURLs.summary);
return response.data;
},