mirror of
https://github.com/mealie-recipes/mealie.git
synced 2026-02-02 14:03:12 -05:00
feat: ✨ add bulk actions service and routes (WIP) (#747)
* feat(frontend): ✨ Group level recipe data management * feat(backend): ✨ add bulk actions service and routes Co-authored-by: Hayden <hay-kot@pm.me>
This commit is contained in:
40
mealie/schema/recipe/recipe_bulk_actions.py
Normal file
40
mealie/schema/recipe/recipe_bulk_actions.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import enum
|
||||
|
||||
from fastapi_camelcase import CamelModel
|
||||
|
||||
from . import CategoryBase, TagBase
|
||||
|
||||
|
||||
class ExportTypes(str, enum.Enum):
|
||||
JSON = "json"
|
||||
|
||||
|
||||
class _ExportBase(CamelModel):
|
||||
recipes: list[str]
|
||||
|
||||
|
||||
class ExportRecipes(_ExportBase):
|
||||
export_type: ExportTypes = ExportTypes.JSON
|
||||
|
||||
|
||||
class AssignCategories(_ExportBase):
|
||||
categories: list[CategoryBase]
|
||||
|
||||
|
||||
class AssignTags(_ExportBase):
|
||||
tags: list[TagBase]
|
||||
|
||||
|
||||
class DeleteRecipes(_ExportBase):
|
||||
pass
|
||||
|
||||
|
||||
class BulkActionError(CamelModel):
|
||||
recipe: str
|
||||
error: str
|
||||
|
||||
|
||||
class BulkActionsResponse(CamelModel):
|
||||
success: bool
|
||||
message: str
|
||||
errors: list[BulkActionError] = []
|
||||
Reference in New Issue
Block a user