Commit 948d2ef
committed
Make
The response coming back from this endpoint has a different shape than
the `TnOption.get()` - it is wrapped in a `<TnOptionOrderResponse>`
element. That element doesn't have any direct `TnOptionGroups` children,
and so this method was throwing when trying to iterate over an undefined
attribute (in `item.tnOptionGroups.forEach(...)`).
Adjusting the tests to use an XML response that matches the
[API documentation](https://dev.bandwidth.com/numbers/apiReference.html)
demonstrates the failure well: the tests time out, because the thrown
error prevents the callback from firing.
The [package documentation](https://github.com/Bandwidth/node-numbers#add-a-portoutpasscode)
suggests that the shape of this response should match `TnOption.get()`,
which we can achieve by just unwrapping the contents from that outermost
`<TnOptionOrderResponse>` element.TnOption.create() invoke its callback1 parent c7c908e commit 948d2ef
3 files changed
+5
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
66 | 66 | | |
67 | 67 | | |
68 | 68 | | |
| 69 | + | |
69 | 70 | | |
70 | 71 | | |
71 | 72 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
120 | | - | |
| 120 | + | |
121 | 121 | | |
122 | 122 | | |
123 | 123 | | |
| |||
152 | 152 | | |
153 | 153 | | |
154 | 154 | | |
155 | | - | |
| 155 | + | |
156 | 156 | | |
157 | 157 | | |
158 | 158 | | |
| |||
189 | 189 | | |
190 | 190 | | |
191 | 191 | | |
192 | | - | |
| 192 | + | |
193 | 193 | | |
194 | 194 | | |
195 | 195 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
6 | 7 | | |
7 | 8 | | |
8 | 9 | | |
| |||
0 commit comments