datajunction-ui 0.0.1-a114 → 0.0.1-a116

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "datajunction-ui",
3
- "version": "0.0.1a114",
3
+ "version": "0.0.1a116",
4
4
  "description": "DataJunction Metrics Platform UI",
5
5
  "module": "src/index.tsx",
6
6
  "repository": {
@@ -1363,13 +1363,9 @@ export const DataJunctionAPI = {
1363
1363
  },
1364
1364
  // GET /notifications/
1365
1365
  getNotificationPreferences: async function (params = {}) {
1366
- const url = new URL(`${DJ_URL}/notifications/`);
1367
- Object.entries(params).forEach(([key, value]) =>
1368
- url.searchParams.append(key, value),
1369
- );
1370
-
1366
+ const query = new URLSearchParams(params).toString();
1371
1367
  return await (
1372
- await fetch(url, {
1368
+ await fetch(`${DJ_URL}/notifications/${query ? `?${query}` : ''}`, {
1373
1369
  credentials: 'include',
1374
1370
  })
1375
1371
  ).json();