feat(spot): last spot fixes

This commit is contained in:
Alexander 2024-09-05 17:02:48 +02:00
parent c8c458764e
commit b46bcee817
2 changed files with 2 additions and 2 deletions

View file

@ -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")

View file

@ -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