Skip to content

Commit

Permalink
Merged in r2-3020-use-role-modules (pull request #6931)
Browse files Browse the repository at this point in the history
R2-3020 - To calculate permitted fields, the module is required only for writes

Approved-by: Pavel Nabutovsky
Approved-by: Alberto Espinoza
  • Loading branch information
dhernandez-quoin authored and aespinoza-quoin committed Sep 19, 2024
2 parents 7ce3df1 + 4bb7edb commit 3a002f7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions app/services/permitted_form_fields_service.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,9 @@ def fetch_filtered_fields(roles, record_type, module_unique_id, visible_only)
fields: {
form_sections: {
roles: { id: roles },
visible: visible_only || nil
}.compact.merge(primero_modules: { unique_id: module_unique_id }, parent_form: record_type)
visible: visible_only || nil,
parent_form: record_type
}.compact.merge(module_unique_id.present? ? { primero_modules: { unique_id: module_unique_id } } : {})
}
)
end
Expand Down

0 comments on commit 3a002f7

Please sign in to comment.