mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-01-17 06:21:22 -05: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:
@@ -53,19 +53,18 @@ const store = new Vuex.Store({
|
||||
},
|
||||
|
||||
actions: {
|
||||
async requestRecentRecipes() {
|
||||
// const keys = [
|
||||
// "name",
|
||||
// "slug",
|
||||
// "image",
|
||||
// "description",
|
||||
// "dateAdded",
|
||||
// "rating",
|
||||
// ];
|
||||
const payload = await api.recipes.allSummary();
|
||||
|
||||
async requestRecentRecipes({ getters }) {
|
||||
const payload = await api.recipes.allSummary(0, 30);
|
||||
const recent = getters.getRecentRecipes;
|
||||
if (recent.length >= 30) return;
|
||||
this.commit("setRecentRecipes", payload);
|
||||
},
|
||||
async requestAllRecipes({ getters }) {
|
||||
const recent = getters.getRecentRecipes;
|
||||
const start = recent.length + 1;
|
||||
const payload = await api.recipes.allSummary(start, 9999);
|
||||
this.commit("setRecentRecipes", [...recent, ...payload]);
|
||||
},
|
||||
async requestCategories({ commit }) {
|
||||
const categories = await api.categories.getAll();
|
||||
commit("setAllCategories", categories);
|
||||
@@ -74,7 +73,6 @@ const store = new Vuex.Store({
|
||||
const tags = await api.tags.getAll();
|
||||
commit("setAllTags", tags);
|
||||
},
|
||||
|
||||
async requestAppInfo({ commit }) {
|
||||
const response = await api.meta.getAppInfo();
|
||||
commit("setAppInfo", response);
|
||||
|
||||
Reference in New Issue
Block a user