centralize all routes

This commit is contained in:
Anika Raemer 2025-09-13 10:19:11 +02:00
parent 5726bdb154
commit a10f3e37c2
5 changed files with 53 additions and 24 deletions

View file

@ -2,6 +2,7 @@ import { useParams, Link } from "react-router-dom"
import type { Recipe } from "../../types/recipe"
import { useEffect, useState } from "react"
import { fetchRecipe } from "../../api/recipePoint"
import { getRecipeEditUrl, getRecipeListUrl } from "../../routes"
/**
@ -123,13 +124,13 @@ export default function RecipeDetailPage() {
{/* Action buttons */}
<div className="button-group">
<Link
to={`/recipe/${recipe.id}/edit`}
to={ getRecipeEditUrl(recipe.id) }
className="primary-button"
>
Bearbeiten
</Link>
<Link
to="/"
to={getRecipeListUrl()}
className="default-button"
>
Zurueck