Commit 0f93acca by ivan Lan

Fix creating order

parent b736f61c
...@@ -47,8 +47,8 @@ module Shotengai ...@@ -47,8 +47,8 @@ module Shotengai
end end
def snapshot_params def snapshot_params
remark_value = params.fetch(:snapshot).fetch(:remark_input, nil)&.permit! remark_value = params.fetch(:snapshot).fetch(:remark_value, nil)&.permit!
info_value = params.fetch(:snapshot).fetch(:info_input, nil)&.permit! info_value = params.fetch(:snapshot).fetch(:info_value, nil)&.permit!
params.fetch(:snapshot).permit( params.fetch(:snapshot).permit(
:shotengai_series_id, :count, :shotengai_series_id, :count,
).merge(remark_value: remark_value, info_value: info_value) ).merge(remark_value: remark_value, info_value: info_value)
......
...@@ -155,7 +155,7 @@ module Shotengai ...@@ -155,7 +155,7 @@ module Shotengai
end end
def check_remark_value def check_remark_value
nullable_keys = series.remark_value.decode.select{ |k, v| v }.keys nullable_keys = (series.remark_value.decode || {}).select{ |k, v| v }&.keys
required_keys = product.remark_template.keys - nullable_keys required_keys = product.remark_template.keys - nullable_keys
absent_keys = required_keys - remark.keys absent_keys = required_keys - remark.keys
# remark 可添加多余字段 # remark 可添加多余字段
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment