Skip to content

Commit

Permalink
Merged in r2-2649-case-appears-unavailable (pull request #6562)
Browse files Browse the repository at this point in the history
R2-2649 - Case created from family details initially appears as unavailable
  • Loading branch information
dhernandez-quoin authored and pnabutovsky committed Oct 26, 2023
2 parents ba646fb + c97d21f commit ec957e9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
11 changes: 3 additions & 8 deletions app/views/api/v2/children/create_family.json.jbuilder
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,9 @@
# Copyright (c) 2014 - 2023 UNICEF. All rights reserved.

json.data do
json.id @current_record.id
json.family_id @current_record.family_id if @selected_field_names.include?('family_id')
json.family_number @current_record.family_number if @selected_field_names.include?('family_number')
json.family_member_id @current_record.family_member_id if @selected_field_names.include?('family_member_id')

if @selected_field_names.include?('family_details_section')
json.family_details_section @current_record.family_members_details
end
json.merge! @record_data_service.embed_family_info(
{ id: @current_record.id }, @current_record, @selected_field_names, current_user
)

json.record do
json.id @record.id
Expand Down
1 change: 1 addition & 0 deletions spec/requests/api/v2/children_controller_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1270,6 +1270,7 @@
expect(json['data']['family_details_section'][0]['relation_age']).to eq(5)
expect(json['data']['family_details_section'][0]['case_id']).not_to be_nil
expect(json['data']['family_details_section'][0]['case_id_display']).not_to be_nil
expect(json['data']['family_details_section'][0]['can_read_record']).not_to be_truthy
expect(json['data']['record']['id']).not_to be_nil
expect(json['data']['record']['case_id_display']).not_to be_nil
expect(json['data']['record']['family_member_id']).to eq(@member_unique_id3)
Expand Down

0 comments on commit ec957e9

Please sign in to comment.