fix product edit

This commit is contained in:
gowthaman 2024-05-09 13:56:59 +05:30
parent 7d99a11e14
commit 1e02deb1b1
2 changed files with 14 additions and 14 deletions

View File

@ -274,13 +274,13 @@ object Auth {
foundOldAt.refreshExpiresAt = LocalDateTime.now().plusSeconds(atResponse.refreshExpiresIn.toLong())
foundOldAt.refreshToken = atResponse.refreshToken
foundOldAt.refreshHistory = (foundOldAt.refreshHistory ?: arrayListOf()).apply {
add(RefreshHistory(
oldAt = authUser.token,
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
newAt = atResponse.accessToken,
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME),
))
add(RefreshHistory().apply {
oldAt = authUser.token
oldExpiryAt = expiresAt.format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
newAt = atResponse.accessToken
newExpiryAt = LocalDateTime.now().plusSeconds(atResponse.expiresIn.toLong()).format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
this.createdAt = LocalDateTime.now().format(DateTimeFormatter.ISO_LOCAL_DATE_TIME)
})
}
database.update(foundOldAt)

View File

@ -688,13 +688,13 @@ open class Plant : BaseModel() {
var prefixes: MutableMap<String, String>? = mutableMapOf()
}
data class RefreshHistory(
val oldAt: String,
val oldExpiryAt: String,
val newAt: String,
val newExpiryAt: String,
val createdAt: String
)
class RefreshHistory {
var oldAt: String = ""
var oldExpiryAt: String = ""
var newAt: String = ""
var newExpiryAt: String = ""
var createdAt: String = ""
}
@Entity
open class AuthTokenCache : BaseModel() {
@Column(columnDefinition = "text")