Skip to content

Commit

Permalink
[fix]
Browse files Browse the repository at this point in the history
  • Loading branch information
goriiin committed Dec 22, 2024
1 parent 67407cb commit 9ab5099
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion internal/repository/orders/create_order_from_cart.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,9 @@ import (
const defaultStatus = "awaiting_payment"

func (r *OrdersRepo) CreateOrderFromCart(ctx context.Context, orderData *order.OrderFromCart) (*order.Order, error) {
tx, err := r.db.BeginTx(ctx, pgx.TxOptions{})
tx, err := r.db.BeginTx(ctx, pgx.TxOptions{
IsoLevel: pgx.Serializable,
})
if err != nil {
r.logger.Error("[OrdersRepo.CreateOrderFromCart] Failed to start transaction", slog.String("error", err.Error()))
return nil, err
Expand Down

0 comments on commit 9ab5099

Please sign in to comment.