Skip to content

Commit

Permalink
리스트 조회에 사진도 추가
Browse files Browse the repository at this point in the history
  • Loading branch information
morecleverer committed Jan 17, 2025
1 parent 6738359 commit e337b90
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion snuvote/app/vote/dto/responses.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ class VotesListInfoResponse(BaseModel):
create_datetime: Annotated[datetime, AfterValidator(convert_utc_to_ktc_naive)] # UTC 시간대를 KST 시간대로 변환한 뒤 offset-naive로 변환
end_datetime: Annotated[datetime, AfterValidator(convert_utc_to_ktc_naive)] # UTC 시간대를 KST 시간대로 변환한 뒤 offset-naive로 변환
participated: bool
image: str| None

@staticmethod
def from_vote_user(vote: Vote, user: User) -> "VotesListInfoResponse":
Expand All @@ -49,7 +50,8 @@ def from_vote_user(vote: Vote, user: User) -> "VotesListInfoResponse":
content=vote.content,
create_datetime=vote.create_datetime,
end_datetime=vote.end_datetime,
participated = participated
participated = participated,
image= vote.images[0].src if vote.images else None
)

class OnGoingVotesListResponse(BaseModel):
Expand Down

0 comments on commit e337b90

Please sign in to comment.