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.time.LocalDateTime
import java.time.ZoneId
import java.time.format.DateTimeFormatter
import java.util.*
import java.util.concurrent.ConcurrentHashMap
@ -275,10 +276,10 @@ object Auth {
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
add(RefreshHistory(
oldAt = authUser.token,
oldExpiryAt = expiresAt,
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
newAt = atResponse.accessToken,
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()),
createdAt = LocalDateTime.now()
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
))
}
database.update(foundOldAt)

View File

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