1
0
Fork 0
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

This commit is contained in:
Michael Genson 2024-04-11 21:28:43 -05:00 committed by GitHub
parent 8ab09cf03b
commit 2a541f081a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
50 changed files with 1497 additions and 443 deletions

View file

@ -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,
};
},