Skip to content

Commit

Permalink
Update order
Browse files Browse the repository at this point in the history
  • Loading branch information
kikakkz committed Sep 4, 2023
1 parent af0e698 commit cf66566
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions pkg/order/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ type updateHandler struct {
}

//nolint:gocyclo
func (h *updateHandler) validate(ctx context.Context) error {
func (h *updateHandler) cancelable(ctx context.Context) error {
appgood, err := appgoodmwcli.GetGoodOnly(ctx, &appgoodmwpb.Conds{
AppID: &basetypes.StringVal{
Op: cruder.EQ,
Expand Down Expand Up @@ -259,14 +259,10 @@ func (h *Handler) UpdateOrder(ctx context.Context) (*npool.Order, error) {
case ordertypes.OrderState_OrderStateWaitPayment:
fallthrough //nolint
case ordertypes.OrderState_OrderStateCheckPayment:
fallthrough //nolint
case ordertypes.OrderState_OrderStatePaymentTimeout:
if h.FromAdmin {
return nil, fmt.Errorf("permission denied")
}
if err := handler.processCancel(ctx); err != nil {
return nil, err
}
fallthrough //nolint
case ordertypes.OrderState_OrderStatePaid:
fallthrough //nolint
case ordertypes.OrderState_OrderStateInService:
Expand Down

0 comments on commit cf66566

Please sign in to comment.