mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-07-25 08:09:41 +02:00
fix: duplicate network calls on index page (#2085)
* Prevent extra recipe load on index page * Prevent loading recipes with food for all components but search ones * add missing change in search page
This commit is contained in:
parent
f3a26f864d
commit
f4b819899d
5 changed files with 12 additions and 4 deletions
|
@ -67,7 +67,7 @@ export const useLazyRecipes = function () {
|
|||
};
|
||||
};
|
||||
|
||||
export const useRecipes = (all = false, fetchRecipes = true) => {
|
||||
export const useRecipes = (all = false, fetchRecipes = true, loadFood = false) => {
|
||||
const api = useUserApi();
|
||||
|
||||
// recipes is non-reactive!!
|
||||
|
@ -88,7 +88,7 @@ export const useRecipes = (all = false, fetchRecipes = true) => {
|
|||
})();
|
||||
|
||||
async function refreshRecipes() {
|
||||
const { data } = await api.recipes.getAll(page, perPage, { loadFood: true, orderBy: "created_at" });
|
||||
const { data } = await api.recipes.getAll(page, perPage, { loadFood, orderBy: "created_at" });
|
||||
if (data) {
|
||||
recipes.value = data.items;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue