From c3eb1d72b45c54db30b52554643868d6de05bb57 Mon Sep 17 00:00:00 2001 From: Mariano Uvalle Date: Mon, 6 Nov 2023 07:33:09 +0000 Subject: [PATCH] Update db interface --- internal/db/db.go | 2 +- internal/db/local.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/db/db.go b/internal/db/db.go index 9d65db0..ef63108 100644 --- a/internal/db/db.go +++ b/internal/db/db.go @@ -8,7 +8,7 @@ type DB interface { GetUser(id string) (*api.User, error) // Devices. - PutDevice(pubKey, userId string) (string, error) + PutDevice(pubKey []byte, userId string) (string, error) GetDevice(id string) (*api.Device, error) GetUserDevices(userId string) ([]*api.Device, error) GetDeviceUser(deviceId string) (*api.User, error) diff --git a/internal/db/local.go b/internal/db/local.go index 840d699..2ee60b5 100644 --- a/internal/db/local.go +++ b/internal/db/local.go @@ -43,7 +43,7 @@ func (d *localDB) GetUser(id string) (*api.User, error) { return u, nil } -func (d *localDB) PutDevice(pubKey, userId string) (string, error) { +func (d *localDB) PutDevice(pubKey []byte, userId string) (string, error) { id := ulid.Make().String() if _, ok := d.users[userId]; !ok { return "", errors.New("user does not exist")