diff --git a/src/main/kotlin/app/revanced/api/configuration/APISchema.kt b/src/main/kotlin/app/revanced/api/configuration/APISchema.kt index 2fa588a..4e50729 100644 --- a/src/main/kotlin/app/revanced/api/configuration/APISchema.kt +++ b/src/main/kotlin/app/revanced/api/configuration/APISchema.kt @@ -1,6 +1,9 @@ package app.revanced.api.configuration +import kotlinx.datetime.Clock import kotlinx.datetime.LocalDateTime +import kotlinx.datetime.TimeZone +import kotlinx.datetime.toLocalDateTime import kotlinx.serialization.Serializable interface ApiUser { @@ -63,7 +66,7 @@ class ApiAnnouncement( val attachments: List = emptyList(), // Using a list instead of a set because set semantics are unnecessary here. val tags: List = emptyList(), - val createdAt: LocalDateTime, + val createdAt: LocalDateTime = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()), val archivedAt: LocalDateTime? = null, val level: Int = 0, ) diff --git a/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt b/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt index 6acfa29..45942f1 100644 --- a/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt +++ b/src/main/kotlin/app/revanced/api/configuration/repository/AnnouncementRepository.kt @@ -100,6 +100,7 @@ internal class AnnouncementRepository(private val database: Database) { author = new.author title = new.title content = new.content + createdAt = new.createdAt archivedAt = new.archivedAt level = new.level tags = SizedCollection(