fix product edit

This commit is contained in:
gowthaman 2024-05-09 13:52:23 +05:30
parent 711983f312
commit 7d99a11e14
2 changed files with 7 additions and 6 deletions

View File

@ -28,6 +28,7 @@ import java.net.http.HttpResponse
import java.nio.charset.StandardCharsets import java.nio.charset.StandardCharsets
import java.time.LocalDateTime import java.time.LocalDateTime
import java.time.ZoneId import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.* import java.util.*
import java.util.concurrent.ConcurrentHashMap import java.util.concurrent.ConcurrentHashMap
@ -275,10 +276,10 @@ object Auth {
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply { foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
add(RefreshHistory( add(RefreshHistory(
oldAt = authUser.token, oldAt = authUser.token,
oldExpiryAt = expiresAt, oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
newAt = atResponse.accessToken, newAt = atResponse.accessToken,
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()), newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
createdAt = LocalDateTime.now() createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
)) ))
} }
database.update(foundOldAt) database.update(foundOldAt)

View File

@ -690,10 +690,10 @@ open class Plant : BaseModel() {
data class RefreshHistory( data class RefreshHistory(
val oldAt: String, val oldAt: String,
val oldExpiryAt: LocalDateTime, val oldExpiryAt: String,
val newAt: String, val newAt: String,
val newExpiryAt: LocalDateTime, val newExpiryAt: String,
val createdAt: LocalDateTime val createdAt: String
) )
@Entity @Entity
open class AuthTokenCache : BaseModel() { open class AuthTokenCache : BaseModel() {