Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions app/posts/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,15 @@ async def update(
post.description = description
post.category = category
post.tags = tags

# 기존 이미지 삭제 후 먼저 flush (INSERT보다 DELETE가 먼저 실행되도록)
post.images.clear()
await self.session.flush()

# 새 이미지 추가
post.images.extend(images)
await self.session.flush()

return post

async def count_by_user_handle(self, *, user_handle: str) -> int:
Expand Down
Loading