mirror of
https://github.com/mealie-recipes/mealie.git
synced 2025-12-02 16:44:05 -05:00
* file structure * auto-test * take 2 * refactor ap scheduler and startup process * fixed scraper error * database abstraction * database abstraction * port recipes over to new schema * meal migration * start settings migration * finale mongo port * backup improvements * migration imports to new DB structure * unused import cleanup * docs strings * settings and theme import logic * cleanup * fixed tinydb error * requirements * fuzzy search * remove scratch file * sqlalchemy models * improved search ui * recipe models almost done * sql modal population * del scratch * rewrite database model mixins * mostly grabage * recipe updates * working sqllite * remove old files and reorganize * final cleanup Co-authored-by: Hayden <hay-kot@pm.me>
35 lines
1.2 KiB
JavaScript
35 lines
1.2 KiB
JavaScript
import HomePage from "./pages/HomePage";
|
|
import Page404 from "./pages/404Page";
|
|
import SearchPage from "./pages/SearchPage";
|
|
import RecipePage from "./pages/RecipePage";
|
|
import RecipeNewPage from "./pages/RecipeNewPage";
|
|
import SettingsPage from "./pages/SettingsPage";
|
|
import MeaplPlanPage from "./pages/MealPlanPage";
|
|
import MealPlanThisWeekPage from "./pages/MealPlanThisWeekPage";
|
|
import api from "./api";
|
|
|
|
export const routes = [
|
|
{ path: "/", component: HomePage },
|
|
{ path: "/mealie", component: HomePage },
|
|
{ path: "/search", component: SearchPage },
|
|
{ path: "/recipe/:recipe", component: RecipePage },
|
|
{ path: "/new/", component: RecipeNewPage },
|
|
{ path: "/settings/site", component: SettingsPage },
|
|
{ path: "/meal-plan/planner", component: MeaplPlanPage },
|
|
{ path: "/meal-plan/this-week", component: MealPlanThisWeekPage },
|
|
{
|
|
path: "/meal-plan/today",
|
|
beforeEnter: async (_to, _from, next) => {
|
|
await todaysMealRoute().then((redirect) => {
|
|
next(redirect);
|
|
});
|
|
},
|
|
},
|
|
{ path: "*", component: Page404 },
|
|
];
|
|
|
|
async function todaysMealRoute() {
|
|
const response = await api.mealPlans.today();
|
|
return "/recipe/" + response.data;
|
|
}
|