mirror of
https://github.com/internetee/registry.git
synced 2025-06-06 04:37:30 +02:00
Fix CC
This commit is contained in:
parent
b708cebbfd
commit
2d510ec3a6
1 changed files with 9 additions and 4 deletions
|
@ -16,13 +16,18 @@ module Api
|
||||||
def update
|
def update
|
||||||
return head(:bad_request) if params[:id].blank?
|
return head(:bad_request) if params[:id].blank?
|
||||||
|
|
||||||
record = ContactRequest.find_by(id: params[:id])
|
result = process_id(params[:id])
|
||||||
return head(:not_found) unless record
|
head(result)
|
||||||
|
end
|
||||||
|
|
||||||
|
def process_id(id)
|
||||||
|
record = ContactRequest.find_by(id: id)
|
||||||
|
return :not_found unless record
|
||||||
|
|
||||||
record.update_status(contact_request_params[:status])
|
record.update_status(contact_request_params[:status])
|
||||||
head(:ok)
|
:ok
|
||||||
rescue StandardError
|
rescue StandardError
|
||||||
head(:bad_request)
|
:bad_request
|
||||||
end
|
end
|
||||||
|
|
||||||
def contact_request_params
|
def contact_request_params
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue