Feature/shareable recipes (#866)

* simplify context menu

* move computed to comp-api

* feat:  create share tokens for recipes for sharing recieps to non-users

* feat:  shareable recipe links with og tags
This commit is contained in:
Hayden
2021-12-05 11:55:46 -09:00
committed by GitHub
parent ba4107348f
commit b2673d75bf
25 changed files with 914 additions and 199 deletions

View File

@@ -0,0 +1,23 @@
from fastapi import Depends
from mealie.routes.routers import UserAPIRouter
from mealie.services._base_http_service.router_factory import RouterFactory
from mealie.services.shared.recipe_shared_service import RecipeShareTokenSummary, SharedRecipeService
router = UserAPIRouter(prefix="/shared")
shared_router = RouterFactory(SharedRecipeService, prefix="/recipes", tags=["Shared: Recipes"])
@shared_router.get("", response_model=list[RecipeShareTokenSummary])
def get_all_shared(
recipe_id: int = None,
shared_recipe_service: SharedRecipeService = Depends(SharedRecipeService.private),
):
"""
Get all shared recipes
"""
return shared_recipe_service.get_all(recipe_id)
router.include_router(shared_router)