diff --git a/backend/app/api/handlers/v1/v1_ctrl_items.go b/backend/app/api/handlers/v1/v1_ctrl_items.go index 36fab51..4990565 100644 --- a/backend/app/api/handlers/v1/v1_ctrl_items.go +++ b/backend/app/api/handlers/v1/v1_ctrl_items.go @@ -167,7 +167,6 @@ func (ctrl *V1Controller) HandleItemUpdate() errchain.HandlerFunc { return adapters.ActionID("id", fn, http.StatusOK) } - // HandleItemPatch godocs // // @Summary Update Item @@ -183,12 +182,12 @@ func (ctrl *V1Controller) HandleItemPatch() errchain.HandlerFunc { auth := services.NewContext(r.Context()) body.ID = ID - err := ctrl.repo.Items.Patch(auth, auth.GID, ID, body) - if err != nil { - return repo.ItemOut{}, err - } + err := ctrl.repo.Items.Patch(auth, auth.GID, ID, body) + if err != nil { + return repo.ItemOut{}, err + } - return ctrl.repo.Items.GetOneByGroup(auth, auth.GID, ID) + return ctrl.repo.Items.GetOneByGroup(auth, auth.GID, ID) } return adapters.ActionID("id", fn, http.StatusOK) diff --git a/backend/app/api/main.go b/backend/app/api/main.go index 8dc733f..19258b0 100644 --- a/backend/app/api/main.go +++ b/backend/app/api/main.go @@ -146,9 +146,9 @@ func run(cfg *config.Config) error { app.server = server.NewServer( server.WithHost(app.conf.Web.Host), server.WithPort(app.conf.Web.Port), - server.WithReadTimeout(app.conf.Web.ReadTimeout), - server.WithWriteTimeout(app.conf.Web.WriteTimeout), - server.WithIdleTimeout(app.conf.Web.IdleTimeout), + server.WithReadTimeout(app.conf.Web.ReadTimeout), + server.WithWriteTimeout(app.conf.Web.WriteTimeout), + server.WithIdleTimeout(app.conf.Web.IdleTimeout), ) log.Info().Msgf("Starting HTTP Server on %s:%s", app.server.Host, app.server.Port) diff --git a/backend/app/api/routes.go b/backend/app/api/routes.go index 50bbfb1..38792a7 100644 --- a/backend/app/api/routes.go +++ b/backend/app/api/routes.go @@ -51,7 +51,7 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllR v1Ctrl := v1.NewControllerV1( a.services, a.repos, - a.bus, + a.bus, v1.WithMaxUploadSize(a.conf.Web.MaxUploadSize), v1.WithRegistration(a.conf.Options.AllowRegistration), v1.WithDemoStatus(a.conf.Demo), // Disable Password Change in Demo Mode @@ -92,7 +92,7 @@ func (a *app) mountRoutes(r *chi.Mux, chain *errchain.ErrChain, repos *repo.AllR r.Post(v1Base("/actions/ensure-asset-ids"), chain.ToHandlerFunc(v1Ctrl.HandleEnsureAssetID(), userMW...)) r.Post(v1Base("/actions/zero-item-time-fields"), chain.ToHandlerFunc(v1Ctrl.HandleItemDateZeroOut(), userMW...)) r.Post(v1Base("/actions/ensure-import-refs"), chain.ToHandlerFunc(v1Ctrl.HandleEnsureImportRefs(), userMW...)) - r.Post(v1Base("/actions/set-primary-photos"), chain.ToHandlerFunc(v1Ctrl.HandleSetPrimaryPhotos(), userMW...)) + r.Post(v1Base("/actions/set-primary-photos"), chain.ToHandlerFunc(v1Ctrl.HandleSetPrimaryPhotos(), userMW...)) r.Get(v1Base("/locations"), chain.ToHandlerFunc(v1Ctrl.HandleLocationGetAll(), userMW...)) r.Post(v1Base("/locations"), chain.ToHandlerFunc(v1Ctrl.HandleLocationCreate(), userMW...)) diff --git a/backend/internal/core/services/reporting/eventbus/eventbus.go b/backend/internal/core/services/reporting/eventbus/eventbus.go index 508e1f0..0f837b3 100644 --- a/backend/internal/core/services/reporting/eventbus/eventbus.go +++ b/backend/internal/core/services/reporting/eventbus/eventbus.go @@ -38,7 +38,7 @@ func New() *EventBus { subscribers: map[Event][]func(any){ EventLabelMutation: {}, EventLocationMutation: {}, - EventItemMutation: {}, + EventItemMutation: {}, }, } } diff --git a/backend/internal/data/repo/main_test.go b/backend/internal/data/repo/main_test.go index 23a4198..dd221f2 100644 --- a/backend/internal/data/repo/main_test.go +++ b/backend/internal/data/repo/main_test.go @@ -13,8 +13,8 @@ import ( ) var ( - fk = faker.NewFaker() - tbus = eventbus.New() + fk = faker.NewFaker() + tbus = eventbus.New() tClient *ent.Client tRepos *AllRepos @@ -45,7 +45,7 @@ func TestMain(m *testing.M) { log.Fatalf("failed opening connection to sqlite: %v", err) } - go tbus.Run() + go tbus.Run() err = client.Schema.Create(context.Background()) if err != nil {