fix(creator): 팬Talk 답글 수정을 확인한다

This commit is contained in:
Yu Sung
2026-07-09 02:54:20 +09:00
parent d96001e213
commit bc9f4ed370
5 changed files with 68 additions and 7 deletions

View File

@@ -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 {