mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-01-01 13:13:22 +08:00
fixes troubles
This commit is contained in:
parent
b07f1af90f
commit
a35bf7182f
1 changed files with 22 additions and 20 deletions
|
@ -80,16 +80,17 @@ class SamplesController < ApplicationController
|
|||
|
||||
errors.delete_if { |k, v| v.blank? }
|
||||
if errors.empty?
|
||||
format.json
|
||||
render json: {
|
||||
id: sample.id,
|
||||
flash: t(
|
||||
'samples.create.success_flash',
|
||||
sample: sample.name,
|
||||
organization: @organization.name
|
||||
)
|
||||
},
|
||||
status: :ok
|
||||
format.json do
|
||||
render json: {
|
||||
id: sample.id,
|
||||
flash: t(
|
||||
'samples.create.success_flash',
|
||||
sample: sample.name,
|
||||
organization: @organization.name
|
||||
)
|
||||
},
|
||||
status: :ok
|
||||
end
|
||||
else
|
||||
format.json { render json: errors, status: :bad_request }
|
||||
end
|
||||
|
@ -236,16 +237,17 @@ class SamplesController < ApplicationController
|
|||
# Now we can destroy empty scfs
|
||||
scf_to_delete.map(&:destroy)
|
||||
|
||||
format.json
|
||||
render json: {
|
||||
id: sample.id,
|
||||
flash: t(
|
||||
'samples.update.success_flash',
|
||||
sample: sample.name,
|
||||
organization: @organization.name
|
||||
)
|
||||
},
|
||||
status: :ok
|
||||
format.json do
|
||||
render json: {
|
||||
id: sample.id,
|
||||
flash: t(
|
||||
'samples.update.success_flash',
|
||||
sample: sample.name,
|
||||
organization: @organization.name
|
||||
)
|
||||
},
|
||||
status: :ok
|
||||
end
|
||||
else
|
||||
format.json { render json: errors, status: :bad_request }
|
||||
end
|
||||
|
|
Loading…
Reference in a new issue