Fixed main issue, bad step structure now gets fixed to empty template

This commit is contained in:
Zanz2 2018-02-15 23:28:20 +01:00
parent 95501eb046
commit c963c948a1
2 changed files with 11 additions and 13 deletions

View file

@ -641,7 +641,6 @@ class ProtocolsController < ApplicationController
end
@json_object = JSON.parse(json_file_contents)
@json_object['steps'] = step_hash_not_null(@json_object['steps'])
byebug
@json_object['steps'] = protocols_io_guid_reorder_step_json(
@json_object['steps']
)
@ -674,7 +673,6 @@ class ProtocolsController < ApplicationController
)
@db_json['steps'] = {}
@json_object['steps'] = step_hash_not_null(@json_object['steps'])
byebug
@db_json['steps'] = protocols_io_fill_step(
@json_object, @db_json['steps']
)

View file

@ -177,21 +177,21 @@ module ProtocolsIoHelper
def generate_null_step_skeleton
json_string = [
{
"guid": 0,
"previous_guid": nil,
"components":
'guid' => '0',
'previous_guid' => nil,
'components' =>
[
{
"component_type_id": '1',
"name": 'Description',
"data": '',
"data_id": nil
'component_type_id' => '1',
'name' => 'Description',
'data' => '',
'data_id' => nil
},
{
"component_type_id": '6',
"name": 'Section',
"data": 'Step',
"data_id": '0'
'component_type_id' => '6',
'name' => 'Section',
'data' => 'Step',
'data_id' => '0'
}
]
}