2021-05-25 21:01:22 -07:00
|
|
|
const ViewRecipe = () => import(/* webpackChunkName: "recipes" */ "@/pages/Recipe/ViewRecipe");
|
|
|
|
|
const NewRecipe = () => import(/* webpackChunkName: "recipes" */ "@/pages/Recipe/NewRecipe");
|
|
|
|
|
const CustomPage = () => import(/* webpackChunkName: "recipes" */ "@/pages/Recipes/CustomPage");
|
|
|
|
|
const AllRecipes = () => import(/* webpackChunkName: "recipes" */ "@/pages/Recipes/AllRecipes");
|
|
|
|
|
const CategoryTagPage = () => import(/* webpackChunkName: "recipes" */ "@/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 },
|
2021-05-23 12:38:55 -08:00
|
|
|
{ path: "/recipes/tag", component: CategoryTagPage },
|
|
|
|
|
{ path: "/recipes/category", component: CategoryTagPage },
|
2021-05-07 14:33:20 -08:00
|
|
|
{ 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;
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
},
|
|
|
|
|
];
|