From c3fae1b14cc2ee8f062547f3b6400757730afd85 Mon Sep 17 00:00:00 2001 From: Akshay Date: Mon, 3 Feb 2025 13:59:00 +0000 Subject: [PATCH] use epoch time in pubkeys table too --- appview/db/pubkeys.go | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/appview/db/pubkeys.go b/appview/db/pubkeys.go index 9817fc0..7315217 100644 --- a/appview/db/pubkeys.go +++ b/appview/db/pubkeys.go @@ -32,9 +32,11 @@ func (d *DB) GetAllPublicKeys() ([]PublicKey, error) { for rows.Next() { var publicKey PublicKey - if err := rows.Scan(&publicKey.Key, &publicKey.Name, &publicKey.DID, &publicKey.Created); err != nil { + var createdAt *int64 + if err := rows.Scan(&publicKey.Key, &publicKey.Name, &publicKey.DID, &createdAt); err != nil { return nil, err } + publicKey.Created = time.Unix(*createdAt, 0) keys = append(keys, publicKey) } @@ -56,9 +58,11 @@ func (d *DB) GetPublicKeys(did string) ([]PublicKey, error) { for rows.Next() { var publicKey PublicKey - if err := rows.Scan(&publicKey.DID, &publicKey.Key, &publicKey.Name, &publicKey.Created); err != nil { + var createdAt *int64 + if err := rows.Scan(&publicKey.DID, &publicKey.Key, &publicKey.Name, &createdAt); err != nil { return nil, err } + publicKey.Created = time.Unix(*createdAt, 0) keys = append(keys, publicKey) } -- knotmirror 0.0.1