Skip to content

Commit

Permalink
Merge pull request #230 from skedify/develop
Browse files Browse the repository at this point in the history
release/next
  • Loading branch information
DemianD authored Mar 25, 2021
2 parents 5544382 + 00ac05a commit 3422598
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/util/convertIdsToString.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
const EXCEPTIONS = ['external_id']
const EXCEPTIONS = ['external_id', 'external_customer_id']

export default function convertIdsToString(json) {
if (json === null) {
Expand Down
8 changes: 7 additions & 1 deletion src/util/convertIdsToString.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,11 +54,17 @@ describe('convertIdsToString', () => {
})

it('should skip conversion of **_id values when it is one of the exceptions', () => {
const response = { example_id: 1, something_else: 2, external_id: 3 }
const response = {
example_id: 1,
something_else: 2,
external_id: 3,
external_customer_id: { order: 0 },
}
expect(convertIdsToString(response)).toEqual({
example_id: '1',
something_else: 2,
external_id: 3, // This is an exception
external_customer_id: { order: 0 }, // This is also an exception
})
})

Expand Down

0 comments on commit 3422598

Please sign in to comment.