| 
									
										
										
										
											2021-07-31 14:45:28 -08:00
										 |  |  | <template> | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  |   <v-container> | 
					
						
							| 
									
										
										
										
											2024-04-11 21:28:43 -05:00
										 |  |  |     <RecipeCardSection | 
					
						
							|  |  |  |       v-if="recipes && isOwnGroup" | 
					
						
							|  |  |  |       :icon="$globals.icons.heart" | 
					
						
							|  |  |  |       :title="$tc('user.user-favorites')" | 
					
						
							|  |  |  |       :recipes="recipes" | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  |       :query="query" | 
					
						
							|  |  |  |       @sortRecipes="assignSorted" | 
					
						
							|  |  |  |       @replaceRecipes="replaceRecipes" | 
					
						
							|  |  |  |       @appendRecipes="appendRecipes" | 
					
						
							|  |  |  |       @delete="removeRecipe" | 
					
						
							| 
									
										
										
										
											2024-04-11 21:28:43 -05:00
										 |  |  |     /> | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  |   </v-container> | 
					
						
							| 
									
										
										
										
											2021-07-31 15:07:19 -08:00
										 |  |  | </template> | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | <script lang="ts"> | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  | import { defineComponent, useRoute } from "@nuxtjs/composition-api"; | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  | import RecipeCardSection from "~/components/Domain/Recipe/RecipeCardSection.vue"; | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  | import { useLazyRecipes } from "~/composables/recipes"; | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  | import { useLoggedInState } from "~/composables/use-logged-in-state"; | 
					
						
							| 
									
										
										
										
											2021-07-31 15:07:19 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | export default defineComponent({ | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  |   components: { RecipeCardSection }, | 
					
						
							| 
									
										
										
										
											2024-01-31 15:25:21 +00:00
										 |  |  |   middleware: "auth", | 
					
						
							| 
									
										
										
										
											2021-07-31 15:07:19 -08:00
										 |  |  |   setup() { | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  |     const route = useRoute(); | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  |     const { isOwnGroup } = useLoggedInState(); | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     const userId = route.value.params.id; | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  |     const query = { queryFilter: `favoritedBy.id = "${userId}"` } | 
					
						
							|  |  |  |     const { recipes, appendRecipes, assignSorted, removeRecipe, replaceRecipes } = useLazyRecipes(); | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  |     return { | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  |       query, | 
					
						
							| 
									
										
										
										
											2024-04-11 21:28:43 -05:00
										 |  |  |       recipes, | 
					
						
							| 
									
										
										
										
											2023-11-05 19:07:02 -06:00
										 |  |  |       isOwnGroup, | 
					
						
							| 
									
										
										
										
											2024-09-22 09:59:20 -05:00
										 |  |  |       appendRecipes, | 
					
						
							|  |  |  |       assignSorted, | 
					
						
							|  |  |  |       removeRecipe, | 
					
						
							|  |  |  |       replaceRecipes, | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  |     }; | 
					
						
							| 
									
										
										
										
											2021-07-31 15:07:19 -08:00
										 |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-10-07 09:39:47 -08:00
										 |  |  |   head() { | 
					
						
							|  |  |  |     return { | 
					
						
							|  |  |  |       title: this.$t("general.favorites") as string, | 
					
						
							|  |  |  |     }; | 
					
						
							|  |  |  |   }, | 
					
						
							| 
									
										
										
										
											2021-07-31 15:07:19 -08:00
										 |  |  | }); | 
					
						
							|  |  |  | </script> | 
					
						
							| 
									
										
										
										
											2022-06-13 09:33:46 -08:00
										 |  |  | 
 | 
					
						
							|  |  |  | <style scoped></style> |