From 2b001d9e7a2136a6d670576843a953115a5c7c25 Mon Sep 17 00:00:00 2001 From: Oswaldo Date: Wed, 22 Feb 2017 14:37:13 -0300 Subject: Return 202 with JSON body on async removals on V4 API --- lib/api/helpers.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'lib/api/helpers.rb') diff --git a/lib/api/helpers.rb b/lib/api/helpers.rb index d0efa7b993b..72d2b320077 100644 --- a/lib/api/helpers.rb +++ b/lib/api/helpers.rb @@ -209,6 +209,10 @@ module API render_api_error!('204 No Content', 204) end + def accepted! + render_api_error!('202 Accepted', 202) + end + def render_validation_error!(model) if model.errors.any? render_api_error!(model.errors.messages || '400 Bad Request', 400) -- cgit v1.2.1