2021-04-21 21:52:12 -08:00
|
|
|
import ViewRecipe from "@/pages/Recipe/ViewRecipe";
|
|
|
|
|
import NewRecipe from "@/pages/Recipe/NewRecipe";
|
|
|
|
|
import CustomPage from "@/pages/Recipes/CustomPage";
|
|
|
|
|
import AllRecipes from "@/pages/Recipes/AllRecipes";
|
2021-05-07 14:33:20 -08:00
|
|
|
import CategoryTagPage from "@/pages/Recipes/CategoryTagPage";
|
2021-04-21 21:52:12 -08:00
|
|
|
import { api } from "@/api";
|
|
|
|
|
|
|
|
|
|
export const recipeRoutes = [
|
|
|
|
|
// Recipes
|
|
|
|
|
{ path: "/recipes/all", component: AllRecipes },
|
2021-05-07 14:33:20 -08:00
|
|
|
{ path: "/recipes/tag/:tag", component: CategoryTagPage },
|
|
|
|
|
{ path: "/recipes/category/:category", component: CategoryTagPage },
|
2021-04-21 21:52:12 -08:00
|
|
|
// Misc
|
|
|
|
|
{ path: "/new/", component: NewRecipe },
|
|
|
|
|
{ path: "/pages/:customPage", component: CustomPage },
|
|
|
|
|
|
|
|
|
|
// Recipe Page
|
|
|
|
|
{
|
|
|
|
|
path: "/recipe/:recipe",
|
|
|
|
|
component: ViewRecipe,
|
|
|
|
|
meta: {
|
|
|
|
|
title: async route => {
|
|
|
|
|
const recipe = await api.recipes.requestDetails(route.params.recipe);
|
|
|
|
|
return recipe.name;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|