Skip to content

Commit

Permalink
Feat: 팀 상세 페이지의 경우 배열로 이미지 전달
Browse files Browse the repository at this point in the history
이미지 여러장을 지원하기 위한 빌드업, 이미지 존재하지 않을 경우는 Null 반환(메인페이지도)
  • Loading branch information
fnzksxl committed Sep 2, 2024
1 parent 8f159b3 commit f2dcefa
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion wtnt/team/serializers.py
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,12 @@ class Meta:
]

def get_image_url(self, obj):
return obj.image + "image.jpg"
if obj.image is None:
return None
else:
# 나중에 이미지 여러장을 지원하기 위해
image_url = obj.image + "image.jpg"
return [image_url]

from rest_framework.fields import empty

Expand Down Expand Up @@ -169,6 +174,8 @@ class Meta:
]

def get_image_url(self, obj):
if obj.image is None:
return None
return obj.image + "thumnail.jpg"


Expand Down

0 comments on commit f2dcefa

Please sign in to comment.