mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-22 14:33:33 -07:00
allow mealplan with no categories
This commit is contained in:
parent
b811ec14cd
commit
741ed9a557
2 changed files with 14 additions and 2 deletions
|
@ -70,7 +70,7 @@ export default {
|
|||
router.push(`/`);
|
||||
},
|
||||
|
||||
async allByKeys(recipeKeys, num = 999) {
|
||||
async allByKeys(recipeKeys, num = 9999) {
|
||||
const response = await apiReq.get(recipeURLs.allRecipes, {
|
||||
params: {
|
||||
keys: recipeKeys,
|
||||
|
|
|
@ -118,6 +118,19 @@ export default {
|
|||
async mounted() {
|
||||
let settings = await api.settings.requestAll();
|
||||
this.items = await api.recipes.getAllByCategory(settings.planCategories);
|
||||
console.log(this.items);
|
||||
|
||||
if (this.items.length === 0) {
|
||||
const keys = [
|
||||
"name",
|
||||
"slug",
|
||||
"image",
|
||||
"description",
|
||||
"dateAdded",
|
||||
"rating",
|
||||
];
|
||||
this.items = await api.recipes.allByKeys(keys);
|
||||
}
|
||||
},
|
||||
|
||||
computed: {
|
||||
|
@ -133,7 +146,6 @@ export default {
|
|||
|
||||
let dateDif = (endDate - startDate) / (1000 * 3600 * 24) + 1;
|
||||
|
||||
|
||||
if (dateDif < 1) {
|
||||
return null;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue