Skip to content

Commit

Permalink
Add status code to benefits controller action
Browse files Browse the repository at this point in the history
These should help Turbo interpret what's going on.
  • Loading branch information
mamhoff committed Dec 3, 2024
1 parent 42d65fd commit d98ec79
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def create
t("spree.successfully_created", resource: SolidusPromotions::Benefit.model_name.human)
redirect_to location_after_save, format: :html
else
render :new, layout: false
render :new, layout: false, status: :unprocessable_entity
end
end

Expand All @@ -28,7 +28,7 @@ def edit
if params.dig(:benefit, :calculator_type)
@benefit.calculator_type = params[:benefit][:calculator_type]
end
render layout: false
render layout: false, status: :unprocessable_entity
end

def update
Expand All @@ -39,7 +39,7 @@ def update
t("spree.successfully_updated", resource: SolidusPromotions::Benefit.model_name.human)
redirect_to location_after_save, format: :html
else
render :edit
render :edit, status: :unprocessable_entity
end
end

Expand Down

0 comments on commit d98ec79

Please sign in to comment.