From 8bb9edfae90c20411b8f0f37b9d3a0820ffd841d Mon Sep 17 00:00:00 2001 From: Bryan Thompson <18094023+SnowboardTechie@users.noreply.github.com> Date: Thu, 21 Nov 2024 11:08:17 -0800 Subject: [PATCH] 422 is more accurate than 400 --- app/controllers/v0/banners_controller.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/controllers/v0/banners_controller.rb b/app/controllers/v0/banners_controller.rb index 4d37bd2725c..dc320f88aba 100644 --- a/app/controllers/v0/banners_controller.rb +++ b/app/controllers/v0/banners_controller.rb @@ -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: }