Skip to content

Commit

Permalink
422 is more accurate than 400
Browse files Browse the repository at this point in the history
  • Loading branch information
SnowboardTechie committed Nov 21, 2024
1 parent e34b576 commit 8bb9edf
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion app/controllers/v0/banners_controller.rb
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ class BannersController < ApplicationController
def by_path
# Default to 'full_width_banner_alert' banner (bundle) type.
banner_type = params.fetch(:type, 'full_width_banner_alert')
return render json: { error: 'Path parameter is required' }, status: :bad_request if path.blank?
return render json: { error: 'Path parameter is required' }, status: :unprocessable_entity if path.blank?

banners = Banner.where(entity_bundle: banner_type).by_path(path)
render json: { banners:, path:, banner_type: }
Expand Down

0 comments on commit 8bb9edf

Please sign in to comment.