mirror of
https://github.com/scinote-eln/scinote-web.git
synced 2025-02-05 22:44:22 +08:00
Merge pull request #446 from okriuchykhin/ok_SCI_902_v2
Add sanitization of group/type to sample edit [SCI-902]
This commit is contained in:
commit
35b8638598
1 changed files with 6 additions and 2 deletions
|
@ -128,8 +128,12 @@ class SamplesController < ApplicationController
|
||||||
sample_group: @sample.sample_group.nil? ? "" : @sample.sample_group.id,
|
sample_group: @sample.sample_group.nil? ? "" : @sample.sample_group.id,
|
||||||
custom_fields: {}
|
custom_fields: {}
|
||||||
},
|
},
|
||||||
sample_groups: @organization.sample_groups.as_json(only: [:id, :name, :color]),
|
sample_groups: @organization.sample_groups.map do |g|
|
||||||
sample_types: @organization.sample_types.as_json(only: [:id, :name])
|
{ id: g.id, name: sanitize_input(g.name), color: g.color }
|
||||||
|
end,
|
||||||
|
sample_types: @organization.sample_types.map do |t|
|
||||||
|
{ id: t.id, name: sanitize_input(t.name) }
|
||||||
|
end
|
||||||
}
|
}
|
||||||
|
|
||||||
# Add custom fields ids as key (easier lookup on js side)
|
# Add custom fields ids as key (easier lookup on js side)
|
||||||
|
|
Loading…
Reference in a new issue