From e4739d572f16386e97c5082877810b756e921bd9 Mon Sep 17 00:00:00 2001 From: aespin Date: Thu, 17 Oct 2024 11:57:15 +0200 Subject: [PATCH] wip --- internal/storage/storage.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/internal/storage/storage.go b/internal/storage/storage.go index b291c35..c696c70 100644 --- a/internal/storage/storage.go +++ b/internal/storage/storage.go @@ -66,7 +66,11 @@ func (s *storage) StoreProductionOrder(ctx context.Context, in *types.Production // ConfirmBundle implements Storager. func (s *storage) ConfirmBundle(ctx context.Context, barcode string) error { - return s.db.Model(&types.BundleData{}).Where("nromatricula = ?", barcode).Update("confirmed", true).Error + bc := &types.Barcode{} + if err := s.db.First(&bc, barcode).Error; err != nil { + return err + } + return s.db.Model(&bc).Where("nromatricula = ?", barcode).Update("confirmed", true).Error } // StoreBarcode implements IStorage.