From b46bcee817c8148e9b3b8a97335c9c7fa5c9fb74 Mon Sep 17 00:00:00 2001 From: Alexander Date: Thu, 5 Sep 2024 17:02:48 +0200 Subject: [PATCH] feat(spot): last spot fixes --- backend/pkg/spot/service/public_key.go | 2 +- backend/pkg/spot/service/spot.go | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/backend/pkg/spot/service/public_key.go b/backend/pkg/spot/service/public_key.go index 36b0ddf83..96ff78c0f 100644 --- a/backend/pkg/spot/service/public_key.go +++ b/backend/pkg/spot/service/public_key.go @@ -44,7 +44,7 @@ func (k *keysImpl) Set(spotID, expiration uint64, user *auth.User) (*Key, error) now := time.Now() if expiration == 0 { - sql := `UPDATE spots_keys SET expired_at = $1, expiration = 0 WHERE spot_id = $2` + sql := `UPDATE spots.keys SET expired_at = $1, expiration = 0 WHERE spot_id = $2` if err := k.conn.Exec(sql, now, spotID); err != nil { k.log.Error(context.Background(), "failed to set key: %v", err) return nil, fmt.Errorf("key not updated") diff --git a/backend/pkg/spot/service/spot.go b/backend/pkg/spot/service/spot.go index aa4e51216..dc2765d19 100644 --- a/backend/pkg/spot/service/spot.go +++ b/backend/pkg/spot/service/spot.go @@ -367,7 +367,7 @@ func (s *spotsImpl) GetStatus(user *auth.User, spotID uint64) (string, error) { case spotID == 0: return "", fmt.Errorf("spot id is required") } - sql := `SELECT status FROM spots WHERE spot_id = $1 AND tenant_id = $2 AND deleted_at IS NULL` + sql := `SELECT status FROM spots.spots WHERE spot_id = $1 AND tenant_id = $2 AND deleted_at IS NULL` var status string if err := s.pgconn.QueryRow(sql, spotID, user.TenantID).Scan(&status); err != nil { return "", err