feat(api): expose budget state (#1640)

* feat(api): expose budget state

* fix(api): guard malformed budget ids

* fix(api): address budget state review

* fix(api): address budget state review

* fix(api): document budget id formats

* fix(api): align budget category docs auth

* fix(api): lighten budget category index payload

* fix(api): use shared pagination clamp

* fix(api): centralize budget filter handling
This commit is contained in:
ghost
2026-05-06 12:50:46 -06:00
committed by GitHub
parent 4b93bdb447
commit 2d38cfb011
18 changed files with 1442 additions and 20 deletions

View File

@@ -35,6 +35,7 @@ class Api::V1::BaseController < ApplicationController
rescue_from ActiveRecord::RecordNotFound, with: :handle_not_found
rescue_from Doorkeeper::Errors::DoorkeeperError, with: :handle_unauthorized
rescue_from ActionController::ParameterMissing, with: :handle_bad_request
rescue_from InvalidFilterError, with: :handle_invalid_filter
private
@@ -256,6 +257,10 @@ class Api::V1::BaseController < ApplicationController
render_json({ error: "bad_request", message: "Required parameters are missing or invalid" }, status: :bad_request)
end
def handle_invalid_filter(exception)
render_validation_error(exception.message)
end
def parse_date_param(key)
Date.iso8601(params[key].to_s)
rescue ArgumentError