Commit Graph

3 Commits

Author SHA1 Message Date
Matt Miller
49a8e2050d Add idempotence tests for asset preview endpoints
Some checks failed
Python Linting / Run Ruff (push) Has been cancelled
Python Linting / Run Pylint (push) Has been cancelled
PUT with the same preview_id twice should be a 200 no-op, and DELETE on
an asset with no preview set should still return 204. The existing test
file covered set/clear happy paths and the 404/400 error cases but did
not exercise idempotence, which is part of the documented contract for
both verbs.
2026-05-07 11:21:12 -07:00
Matt Miller
cc288f6ae1 Fix Ruff lint failures
- Drop unused 'result' assignment in clear_asset_preview_route (DELETE
  returns 204, the result isn't needed).
- Remove unused 'pytest' import from test_preview.py.
2026-05-06 17:32:06 -07:00
Cursor Agent
d7e43f42d6
Add asset preview management endpoints (PUT/DELETE /api/assets/{id}/preview)
- PUT /api/assets/{id}/preview: sets the preview asset for an existing asset,
  returns the full updated Asset object. Returns 404 if asset ID doesn't exist.
- DELETE /api/assets/{id}/preview: clears the preview asset link, returns 204.
  Returns 404 if asset ID doesn't exist.

Added OpenAPI spec entries under the assets tag with no x-runtime restriction.
Implemented handlers using the existing set_asset_preview service function.
Added integration tests covering happy paths and 404 cases.

Co-authored-by: Matt Miller <MillerMedia@users.noreply.github.com>
2026-05-06 23:56:26 +00:00