Refactor API of /api/v2/users/{uid}/subscriptions

This commit is contained in:
2023-07-30 15:58:37 +02:00
parent 8a6719fc19
commit 165c6d8614
23 changed files with 430 additions and 218 deletions

View File

@@ -4,6 +4,7 @@ import (
"blackforestbytes.com/simplecloudnotifier/db"
"blackforestbytes.com/simplecloudnotifier/models"
"database/sql"
"errors"
"gogs.mikescher.com/BlackForestBytes/goext/langext"
"gogs.mikescher.com/BlackForestBytes/goext/sq"
"strings"
@@ -90,7 +91,7 @@ func (db *Database) GetKeyTokenByToken(ctx db.TxContext, key string) (*models.Ke
}
user, err := models.DecodeKeyToken(rows)
if err == sql.ErrNoRows {
if errors.Is(err, sql.ErrNoRows) {
return nil, nil
}
if err != nil {