Skip to content

Commit

Permalink
Merge pull request #474 from mannodermaus/api/eventresponse-nullable-…
Browse files Browse the repository at this point in the history
…message

Make EventResponse#message field nullable
  • Loading branch information
takahirom authored Aug 15, 2024
2 parents ee053d8 + c11c37c commit d9de76d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ public fun EventMapResponse.toEventMapList(): PersistentList<EventMapEvent> {
enTitle = event.i18nDesc.en,
),
moreDetailsUrl = event.moreDetailsUrl,
message = event.message.toMultiLangText(),
message = event.message?.toMultiLangText(),
)
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import kotlinx.serialization.Serializable
public data class EventResponse(
val i18nDesc: I18nDescResponse,
val id: String,
val message: MessageResponse,
val message: MessageResponse?,
val moreDetailsUrl: String?,
val noShow: Boolean,
val roomId: Int,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,14 @@ public fun EventMapEvent.Companion.fakes(): PersistentList<EventMapEvent> = Room
} else {
null
},
message = MultiLangText(
"※こちらのイベントは時間が変更されました。",
"※This event has been rescheduled.",
),
message = if (it.ordinal % 3 == 0) {
MultiLangText(
"※こちらのイベントは時間が変更されました。",
"※This event has been rescheduled.",
)
} else {
null
},
)
}.toPersistentList()

Expand Down

0 comments on commit d9de76d

Please sign in to comment.