fix(creator): 팬Talk 답글 수정을 확인한다
This commit is contained in:
@@ -18,6 +18,21 @@ struct CreatorChannelFanTalkItemResponse: Decodable, Identifiable {
|
||||
let creatorReplies: [CreatorChannelFanTalkReplyResponse]
|
||||
|
||||
var id: Int { fanTalkId }
|
||||
|
||||
var latestCreatorReply: CreatorChannelFanTalkReplyResponse? {
|
||||
creatorReplies.max { lhs, rhs in
|
||||
switch (DateParser.parse(lhs.createdAtUtc), DateParser.parse(rhs.createdAtUtc)) {
|
||||
case let (lhsDate?, rhsDate?):
|
||||
return lhsDate < rhsDate
|
||||
case (nil, _?):
|
||||
return true
|
||||
case (_?, nil):
|
||||
return false
|
||||
case (nil, nil):
|
||||
return lhs.createdAtUtc < rhs.createdAtUtc
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
struct CreatorChannelFanTalkReplyResponse: Decodable, Identifiable {
|
||||
|
||||
Reference in New Issue
Block a user