mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-11-12 09:20:45 +08:00
fixes troubles
This commit is contained in:
parent
b07f1af90f
commit
a35bf7182f
1 changed files with 22 additions and 20 deletions
|
|
@ -80,7 +80,7 @@ class SamplesController < ApplicationController
|
||||||
|
|
||||||
errors.delete_if { |k, v| v.blank? }
|
errors.delete_if { |k, v| v.blank? }
|
||||||
if errors.empty?
|
if errors.empty?
|
||||||
format.json
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
id: sample.id,
|
id: sample.id,
|
||||||
flash: t(
|
flash: t(
|
||||||
|
|
@ -90,6 +90,7 @@ class SamplesController < ApplicationController
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status: :ok
|
status: :ok
|
||||||
|
end
|
||||||
else
|
else
|
||||||
format.json { render json: errors, status: :bad_request }
|
format.json { render json: errors, status: :bad_request }
|
||||||
end
|
end
|
||||||
|
|
@ -236,7 +237,7 @@ class SamplesController < ApplicationController
|
||||||
# Now we can destroy empty scfs
|
# Now we can destroy empty scfs
|
||||||
scf_to_delete.map(&:destroy)
|
scf_to_delete.map(&:destroy)
|
||||||
|
|
||||||
format.json
|
format.json do
|
||||||
render json: {
|
render json: {
|
||||||
id: sample.id,
|
id: sample.id,
|
||||||
flash: t(
|
flash: t(
|
||||||
|
|
@ -246,6 +247,7 @@ class SamplesController < ApplicationController
|
||||||
)
|
)
|
||||||
},
|
},
|
||||||
status: :ok
|
status: :ok
|
||||||
|
end
|
||||||
else
|
else
|
||||||
format.json { render json: errors, status: :bad_request }
|
format.json { render json: errors, status: :bad_request }
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue