Improve 'item not found' pages (#3438)

* Make scene 'not found' page consistent
* Make backend response for no result consistent
This commit is contained in:
DingDongSoLong4
2023-02-16 01:12:01 +02:00
committed by GitHub
parent a1e7f8940b
commit 8437e10027
9 changed files with 54 additions and 35 deletions

View File

@@ -2,6 +2,8 @@ package api
import (
"context"
"database/sql"
"errors"
"strconv"
"github.com/99designs/gqlgen/graphql"
@@ -23,7 +25,7 @@ func (r *queryResolver) FindImage(ctx context.Context, id *string, checksum *str
}
image, err = qb.Find(ctx, idInt)
if err != nil {
if err != nil && !errors.Is(err, sql.ErrNoRows) {
return err
}
} else if checksum != nil {