mirror of
https://github.com/hexolan/stocklet.git
synced 2026-03-26 11:41:18 +00:00
chore(deps): bump protovalidate to v1.0.0
bump version v0.4.1 (`e097f827e65240ac9fd4b1158849a8fc`) to v1.0.0 (`52f32327d4b045a79293a6ad4e7e1236`) refactor: endpoint from `github.com/bufbuild/protovalidate-go` to `buf.build/go/protovalidate` chore(deps): bump other dependencies
This commit is contained in:
@@ -18,7 +18,7 @@ package shipping
|
||||
import (
|
||||
"context"
|
||||
|
||||
"github.com/bufbuild/protovalidate-go"
|
||||
"buf.build/go/protovalidate"
|
||||
"github.com/rs/zerolog/log"
|
||||
"google.golang.org/protobuf/types/known/emptypb"
|
||||
|
||||
@@ -66,7 +66,7 @@ func NewShippingService(cfg *ServiceConfig, store StorageController) *ShippingSe
|
||||
// Initialise the service
|
||||
return &ShippingService{
|
||||
store: store,
|
||||
pbVal: pbVal,
|
||||
pbVal: &pbVal,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ func (svc ShippingService) ServiceInfo(ctx context.Context, req *commonpb.Servic
|
||||
|
||||
func (svc ShippingService) ViewShipment(ctx context.Context, req *pb.ViewShipmentRequest) (*pb.ViewShipmentResponse, error) {
|
||||
// Validate the request args
|
||||
if err := svc.pbVal.Validate(req); err != nil {
|
||||
if err := (*svc.pbVal).Validate(req); err != nil {
|
||||
// Provide the validation error to the user.
|
||||
return nil, errors.NewServiceError(errors.ErrCodeInvalidArgument, "invalid request: "+err.Error())
|
||||
}
|
||||
@@ -98,7 +98,7 @@ func (svc ShippingService) ViewShipment(ctx context.Context, req *pb.ViewShipmen
|
||||
|
||||
func (svc ShippingService) ViewShipmentManifest(ctx context.Context, req *pb.ViewShipmentManifestRequest) (*pb.ViewShipmentManifestResponse, error) {
|
||||
// Validate the request args
|
||||
if err := svc.pbVal.Validate(req); err != nil {
|
||||
if err := (*svc.pbVal).Validate(req); err != nil {
|
||||
// Provide the validation error to the user.
|
||||
return nil, errors.NewServiceError(errors.ErrCodeInvalidArgument, "invalid request: "+err.Error())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user