mirror of
https://github.com/mealie-recipes/mealie.git
synced 2024-12-26 05:51:21 -08:00
7c274de778
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
53 lines
1.3 KiB
Vue
53 lines
1.3 KiB
Vue
<template>
|
|
<v-container>
|
|
<RecipeCardSection
|
|
v-if="recipes && isOwnGroup"
|
|
:icon="$globals.icons.heart"
|
|
:title="$tc('user.user-favorites')"
|
|
:recipes="recipes"
|
|
:query="query"
|
|
@sortRecipes="assignSorted"
|
|
@replaceRecipes="replaceRecipes"
|
|
@appendRecipes="appendRecipes"
|
|
@delete="removeRecipe"
|
|
/>
|
|
</v-container>
|
|
</template>
|
|
|
|
<script lang="ts">
|
|
import { defineComponent, useRoute } from "@nuxtjs/composition-api";
|
|
import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue";
|
|
import { useLazyRecipes } from "~/composables/recipes";
|
|
import { useLoggedInState } from "~/composables/use-logged-in-state";
|
|
|
|
export default defineComponent({
|
|
components: { RecipeCardSection },
|
|
middleware: "auth",
|
|
setup() {
|
|
const route = useRoute();
|
|
const { isOwnGroup } = useLoggedInState();
|
|
|
|
const userId = route.value.params.id;
|
|
const query = { queryFilter: `favoritedBy.id = "${userId}"` }
|
|
const { recipes, appendRecipes, assignSorted, removeRecipe, replaceRecipes } = useLazyRecipes();
|
|
|
|
return {
|
|
query,
|
|
recipes,
|
|
isOwnGroup,
|
|
appendRecipes,
|
|
assignSorted,
|
|
removeRecipe,
|
|
replaceRecipes,
|
|
};
|
|
},
|
|
head() {
|
|
return {
|
|
title: this.$t("general.favorites") as string,
|
|
};
|
|
},
|
|
});
|
|
</script>
|
|
|
|
<style scoped></style>
|