Skip to content

Commit

Permalink
Merge pull request #146 from TUK-DP/feat/140
Browse files Browse the repository at this point in the history
[refactor] diary 키워드가 없는경우 diary 그림 띄울수 있게 diary imgUrl 추가
  • Loading branch information
rvbear authored Jun 14, 2024
2 parents fb662dc + 1f997ef commit fdb21ea
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion diary/serialziers/diary_response_serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ class GetDiaryByIdResponse(serializers.Serializer):
createDate = serializers.DateField()
content = serializers.CharField()
keywords = KeywordResponse(many=True)
imgUrl = serializers.CharField()

@staticmethod
def to_json(diary: Diary):
Expand All @@ -36,7 +37,8 @@ def to_json(diary: Diary):
'title': diary.title,
'createDate': diary.createDate,
'content': diary.content,
'keywords': [KeywordResponse.to_json(keyword) for keyword in diary.keywords.all()]
'keywords': [KeywordResponse.to_json(keyword) for keyword in diary.keywords.all()],
'imgUrl': diary.imgUrl
}


Expand Down

0 comments on commit fdb21ea

Please sign in to comment.