mirror of
https://github.com/hay-kot/mealie.git
synced 2025-08-14 02:37:11 -07:00
feat: Filter Recipes By Household (and a ton of bug fixes) (#4207)
Co-authored-by: Kuchenpirat <24235032+Kuchenpirat@users.noreply.github.com>
This commit is contained in:
parent
2a6922a85c
commit
7c274de778
65 changed files with 896 additions and 590 deletions
|
@ -1,7 +1,7 @@
|
|||
from abc import ABC
|
||||
from logging import Logger
|
||||
|
||||
from fastapi import Depends
|
||||
from fastapi import Depends, HTTPException
|
||||
from pydantic import UUID4, ConfigDict
|
||||
from sqlalchemy.orm import Session
|
||||
|
||||
|
@ -97,6 +97,12 @@ class BasePublicGroupExploreController(BasePublicController):
|
|||
def group_id(self) -> UUID4 | None | NotSet:
|
||||
return self.group.id
|
||||
|
||||
def get_public_household(self, household_slug_or_id: str | UUID4) -> HouseholdInDB:
|
||||
household = self.repos.households.get_by_slug_or_id(household_slug_or_id)
|
||||
if not household or household.preferences.private_household:
|
||||
raise HTTPException(404, "household not found")
|
||||
return household
|
||||
|
||||
def get_explore_url_path(self, endpoint: str) -> str:
|
||||
if endpoint.startswith("/"):
|
||||
endpoint = endpoint[1:]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue