1
0
Fork 0
mirror of https://github.com/mealie-recipes/mealie.git synced 2025-08-03 20:45:23 +02:00

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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 128 additions and 73 deletions

View file

@ -116,6 +116,7 @@ export default {
},
async mounted() {
await this.$store.dispatch("requestCurrentGroup");
await this.$store.dispatch("requestAllRecipes");
await this.buildMealStore();
},
@ -151,6 +152,9 @@ export default {
const recipes = this.items.filter(x => !this.usedRecipes.includes(x));
return recipes.length > 0 ? recipes : this.items;
},
allRecipes() {
return this.$store.getters.getRecentRecipes;
},
},
methods: {
@ -159,15 +163,7 @@ export default {
this.items = await api.recipes.getAllByCategory(categories);
if (this.items.length === 0) {
const keys = [
"name",
"slug",
"image",
"description",
"dateAdded",
"rating",
];
this.items = await api.recipes.allByKeys(keys);
this.items = this.allRecipes;
}
},
getRandom(list) {