indicar a la raspberry que el registro es duplicado
This commit is contained in:
parent
58e5186239
commit
01700017e9
1 changed files with 2 additions and 1 deletions
|
@ -14,7 +14,6 @@ class ReadingsController < ActionController::API
|
||||||
Reading.transaction do
|
Reading.transaction do
|
||||||
reading = raspberry.readings.build reading_params
|
reading = raspberry.readings.build reading_params
|
||||||
reading.id = params[:transaction_uuid]
|
reading.id = params[:transaction_uuid]
|
||||||
# TODO: Verificar firma
|
|
||||||
reading.signature = request.headers[:'X-Signature']
|
reading.signature = request.headers[:'X-Signature']
|
||||||
|
|
||||||
params[:arduinos]&.each do |a|
|
params[:arduinos]&.each do |a|
|
||||||
|
@ -31,6 +30,8 @@ class ReadingsController < ActionController::API
|
||||||
head :bad_request
|
head :bad_request
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
rescue ActiveRecord::RecordNotUnique
|
||||||
|
render plain: params[:transaction_uuid], status: :ok
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|
Loading…
Reference in a new issue