I had a case where a division returned in the response didn't have key/value pair for officeIds or offices in the response and it would break parsing.
By drawing from the division.office_ids and division.offices after they loaded, and thus empty values are treated as an empty array, we fix this brittleness.
Refactored code into smaller methods along the way as well as moving away from a class method.
I had a case where a division returned in the response didn't have key/value pair for officeIds or offices in the response and it would break parsing.
By drawing from the division.office_ids and division.offices after they loaded, and thus empty values are treated as an empty array, we fix this brittleness.
Refactored code into smaller methods along the way as well as moving away from a class method.