Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
coddmeistr committed Dec 11, 2024
1 parent 380136b commit 21f398e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/graph/promocodes.go
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,7 @@ func (c *promocodesController) Delete(ctx context.Context, uuid string) error {
func (c *promocodesController) Get(ctx context.Context, uuid string) (*pb.Promocode, error) {
log := c.log.Named("Get")

var promo *pb.Promocode
var promo pb.Promocode

meta, err := c.col.ReadDocument(ctx, uuid, &promo)
if err != nil {
Expand All @@ -200,7 +200,7 @@ func (c *promocodesController) Get(ctx context.Context, uuid string) (*pb.Promoc
}

promo.Uuid = meta.Key
return applyCurrentState(promo), nil
return applyCurrentState(&promo), nil
}

const getByCodeQuery = `FOR p IN @@promocodes FILTER p.code == @code RETURN p`
Expand All @@ -219,15 +219,15 @@ func (c *promocodesController) GetByCode(ctx context.Context, code string) (*pb.
if !cur.HasMore() {
return nil, fmt.Errorf("promocode with code %s not found", code)
}
var promo *pb.Promocode
var promo pb.Promocode
meta, err := cur.ReadDocument(ctx, &promo)
if err != nil {
log.Error("Failed to get document", zap.Error(err))
return nil, err
}

promo.Uuid = meta.Key
return applyCurrentState(promo), nil
return applyCurrentState(&promo), nil
}

func (c *promocodesController) List(ctx context.Context, req *pb.ListPromocodesRequest) ([]*pb.Promocode, error) {
Expand Down

0 comments on commit 21f398e

Please sign in to comment.