mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-08-02 20:15:24 +02:00
feat: User-specific Recipe Ratings (#3345)
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker Nightly Production / Backend Server Tests (push) Has been cancelled
Docker Nightly Production / Frontend and End-to-End Tests (push) Has been cancelled
Docker Nightly Production / Build Tagged Release (push) Has been cancelled
Docker Nightly Production / Notify Discord (push) Has been cancelled
Some checks failed
CodeQL / Analyze (javascript-typescript) (push) Has been cancelled
CodeQL / Analyze (python) (push) Has been cancelled
Docker Nightly Production / Backend Server Tests (push) Has been cancelled
Docker Nightly Production / Frontend and End-to-End Tests (push) Has been cancelled
Docker Nightly Production / Build Tagged Release (push) Has been cancelled
Docker Nightly Production / Notify Discord (push) Has been cancelled
This commit is contained in:
parent
8ab09cf03b
commit
2a541f081a
50 changed files with 1497 additions and 443 deletions
|
@ -1,7 +1,11 @@
|
|||
<template>
|
||||
<v-container>
|
||||
<RecipeCardSection v-if="user && isOwnGroup" :icon="$globals.icons.heart" :title="$tc('user.user-favorites')" :recipes="user.favoriteRecipes">
|
||||
</RecipeCardSection>
|
||||
<RecipeCardSection
|
||||
v-if="recipes && isOwnGroup"
|
||||
:icon="$globals.icons.heart"
|
||||
:title="$tc('user.user-favorites')"
|
||||
:recipes="recipes"
|
||||
/>
|
||||
</v-container>
|
||||
</template>
|
||||
|
||||
|
@ -21,14 +25,13 @@ export default defineComponent({
|
|||
const { isOwnGroup } = useLoggedInState();
|
||||
|
||||
const userId = route.value.params.id;
|
||||
|
||||
const user = useAsync(async () => {
|
||||
const { data } = await api.users.getFavorites(userId);
|
||||
return data;
|
||||
const recipes = useAsync(async () => {
|
||||
const { data } = await api.recipes.getAll(1, -1, { queryFilter: `favoritedBy.id = "${userId}"` });
|
||||
return data?.items || null;
|
||||
}, useAsyncKey());
|
||||
|
||||
return {
|
||||
user,
|
||||
recipes,
|
||||
isOwnGroup,
|
||||
};
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue