feat: new-card-design (#196)

* card option 1

* UI updates for item card

* fix test error

* fix pagination issues on backend

* add integer support

* remove date from cards

* implement pagination for search page

* resolve search state problems

* other fixes

* fix broken datetime

* attempt to fix scroll behavior
This commit is contained in:
Hayden 2023-01-01 13:50:48 -08:00 committed by GitHub
parent 58d6f9a28c
commit 891d41b75f
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
19 changed files with 393 additions and 142 deletions

View file

@ -1,6 +1,8 @@
package v1
import (
"database/sql"
"errors"
"net/http"
"github.com/hay-kot/homebox/backend/internal/core/services"
@ -41,6 +43,11 @@ func (ctrl *V1Controller) HandleItemsGetAll() server.HandlerFunc {
ctx := services.NewContext(r.Context())
items, err := ctrl.repo.Items.QueryByGroup(ctx, ctx.GID, extractQuery(r))
if err != nil {
if errors.Is(err, sql.ErrNoRows) {
return server.Respond(w, http.StatusOK, repo.PaginationResult[repo.ItemSummary]{
Items: []repo.ItemSummary{},
})
}
log.Err(err).Msg("failed to get items")
return validate.NewRequestError(err, http.StatusInternalServerError)
}