diff --git a/internal/api/shelves.go b/internal/api/shelves.go index 134c408..26d3fc2 100644 --- a/internal/api/shelves.go +++ b/internal/api/shelves.go @@ -107,7 +107,7 @@ func (s *APIServer) createShelf(w http.ResponseWriter, r *http.Request) error { Name: data.Name, RoomNumber: data.RoomNumber, Description: data.Description, - BuildingID: data.BuildingID, + BuildingID: *data.BuildingID, } err := s.db.CreateShelfLocation(shelf) @@ -158,7 +158,7 @@ func (s *APIServer) updateShelf(w http.ResponseWriter, r *http.Request) error { shelf := &types.ShelfLocation{ ID: eShelf.ID, Name: data.Name, - BuildingID: data.BuildingID, + BuildingID: *data.BuildingID, RoomNumber: data.RoomNumber, }