feat: implement media asset reactivation and enhance lifecycle management
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 31s
Deploy Development / deploy (push) Successful in 34s
Test Suite / pytest-backend (push) Successful in 24s
Test Suite / lint-backend (push) Successful in 0s
Test Suite / build-frontend (push) Successful in 6s
Test Suite / playwright-tests (push) Successful in 31s
- Added a new action to the media asset lifecycle for reactivating assets from the trash, allowing users to restore previously deleted media. - Updated the backend API to handle reactivation requests and ensure proper state transitions for media assets. - Enhanced frontend error handling to prompt users for reactivation when attempting to upload media that matches an existing asset in the trash. - Incremented version to 0.8.45, reflecting the latest changes in media lifecycle management and user experience improvements.
This commit is contained in:
1 parent
e2964a077d
commit
da368222e0
8 files changed
+198
-44
No files matched your search
@@ -17,7 +17,7 @@ router = APIRouter(prefix="/api/media-assets", tags=["media-assets"])
|
||||
|
||||
|
||||
class MediaLifecycleBody(BaseModel):
|
||||
action: Literal["trash_soft", "trash_hidden", "recover", "purge"]
|
||||
action: Literal["trash_soft", "trash_hidden", "recover", "purge", "reactivate"]
|
||||
|
||||
|
||||
def _fetch_asset_file_row(cur: Any, asset_id: int) -> Optional[dict]:
|
||||
@@ -171,5 +171,9 @@ def post_media_asset_lifecycle(
|
||||
if not ok:
|
||||
raise HTTPException(status_code=400, detail="Löschen nicht möglich")
|
||||
return {"ok": True, "purged": asset_id}
|
||||
if action == "reactivate":
|
||||
from media_lifecycle import reactivate_media_asset_from_trash
|
||||
|
||||
return reactivate_media_asset_from_trash(cur, conn, asset_id)
|
||||
|
||||
raise HTTPException(status_code=500, detail="Interner Fehler: lifecycle action")
|
||||
Reference in new issue
Block a user