mirror of
				https://github.com/mealie-recipes/mealie.git
				synced 2025-10-31 02:03:35 -04:00 
			
		
		
		
	* WIP: proof of concept * basic meta tag injection * add support for scraping public/private links * make tests go brrrrr * cleanup initialization * rewrite build config * remove recipe meta on frontend * make type checker happy * remove other deployment methods * fix issue with JSON response on un-authenticated request * docs updates * update tivy scanner * fix linter stuff * change registry tag * build fixes * fix same mistake I always make
		
			
				
	
	
		
			47 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
			
		
		
	
	
			47 lines
		
	
	
		
			1.0 KiB
		
	
	
	
		
			Vue
		
	
	
	
	
	
| <template>
 | |
|   <div>
 | |
|     <client-only>
 | |
|       <RecipePage v-if="recipe" :recipe="recipe" />
 | |
|     </client-only>
 | |
|   </div>
 | |
| </template>
 | |
| 
 | |
| <script lang="ts">
 | |
| import { defineComponent, ref, useAsync, useMeta, useRoute, useRouter } from "@nuxtjs/composition-api";
 | |
| import RecipePage from "~/components/Domain/Recipe/RecipePage/RecipePage.vue";
 | |
| import { usePublicApi } from "~/composables/api/api-client";
 | |
| 
 | |
| export default defineComponent({
 | |
|   components: { RecipePage },
 | |
|   layout: "basic",
 | |
|   setup() {
 | |
|     const route = useRoute();
 | |
|     const router = useRouter();
 | |
|     const recipeId = route.value.params.id;
 | |
|     const api = usePublicApi();
 | |
| 
 | |
|     const { title } = useMeta();
 | |
| 
 | |
|     const recipe = useAsync(async () => {
 | |
|       const { data, error } = await api.shared.getShared(recipeId);
 | |
| 
 | |
|       if (error) {
 | |
|         console.error("error loading recipe -> ", error);
 | |
|         router.push("/");
 | |
|       }
 | |
| 
 | |
|       if (data) {
 | |
|         title.value = data?.name || "";
 | |
|       }
 | |
| 
 | |
|       return data;
 | |
|     });
 | |
| 
 | |
|     return {
 | |
|       recipe,
 | |
|     };
 | |
|   },
 | |
|   head: {},
 | |
| });
 | |
| </script>
 |