mirror of
https://github.com/revanced/revanced-api.git
synced 2025-04-29 14:14:29 +02:00
feat: Allow setting Announcement.createdAt
when creating an announcement
This commit is contained in:
parent
48469d32c2
commit
7f6e29de52
@ -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<String> = emptyList(),
|
||||
// Using a list instead of a set because set semantics are unnecessary here.
|
||||
val tags: List<String> = emptyList(),
|
||||
val createdAt: LocalDateTime,
|
||||
val createdAt: LocalDateTime = Clock.System.now().toLocalDateTime(TimeZone.currentSystemDefault()),
|
||||
val archivedAt: LocalDateTime? = null,
|
||||
val level: Int = 0,
|
||||
)
|
||||
|
@ -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(
|
||||
|
Loading…
x
Reference in New Issue
Block a user