Commit 3d1810d
committed
Normalize API responses for Bouncers and Hub
Make response handling more defensive across two pages: Bouncers.tsx now reads response.data.data into a local `raw` and adapts to either an array or a wrapped object (e.g. { bouncers: [...] }). If the backend returns an object, it scans values for the first array and returns it; otherwise it falls back to an empty array. HubBrowser.tsx now returns `response.data.data ?? null` to explicitly yield null when data is absent. These changes make the UI resilient to varying backend response shapes.1 parent b47b2eb commit 3d1810d
2 files changed
Lines changed: 10 additions & 7 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | | - | |
56 | | - | |
57 | | - | |
58 | | - | |
59 | | - | |
60 | | - | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
61 | 64 | | |
62 | 65 | | |
63 | 66 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
103 | 103 | | |
104 | 104 | | |
105 | 105 | | |
106 | | - | |
| 106 | + | |
107 | 107 | | |
108 | 108 | | |
109 | 109 | | |
| |||
0 commit comments