Soft-delete a study guide
DELETE/study-guides/:study_guide_id
Soft-deletes the guide (study_guides.deleted_at = now()) and
cascades to all child quizzes (quizzes.deleted_at = now())
atomically in a single transaction. Application-level cascade
(not DB CASCADE) so quizzes keep their own deleted_at lifecycle
for any future undelete workflow.
Creator-only: 403 if the viewer is not the guide's creator. 404 for missing or already-deleted guides. Order of checks:
- Fetch + lock guide row.
- 404 if missing or deleted_at IS NOT NULL.
- 403 if creator_id != viewer_id.
- UPDATE guide + child quizzes, COMMIT.
Request
Responses
- 204
- 400
- 401
- 403
- 404
- 500
Guide soft-deleted; no response body
Bad request
Unauthorized
Forbidden
Not found
Internal server error