chore: merge with dev

This commit is contained in:
Chris Holland 2024-10-23 20:06:17 -07:00
parent b678ac86e8
commit 3430cfdb3a
No known key found for this signature in database
GPG key ID: 68B0A864B1B0A0D2
34 changed files with 3515 additions and 2600 deletions

3538
apps/api/poetry.lock generated

File diff suppressed because it is too large Load diff

View file

@ -195,16 +195,16 @@ async def delete_chapter(
# RBAC check
await rbac_check(request, chapter.chapter_uuid, current_user, "delete", db_session)
db_session.delete(chapter)
db_session.commit()
# Remove all linked activities
statement = select(ChapterActivity).where(ChapterActivity.id == chapter.id)
# Remove all linked chapter activities
statement = select(ChapterActivity).where(ChapterActivity.chapter_id == chapter.id)
chapter_activities = db_session.exec(statement).all()
for chapter_activity in chapter_activities:
db_session.delete(chapter_activity)
db_session.commit()
# Delete the chapter
db_session.delete(chapter)
db_session.commit()
return {"detail": "chapter deleted"}