@dpgradio/creative 5.1.0 → 5.1.1

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": "@dpgradio/creative",
3
- "version": "5.1.0",
3
+ "version": "5.1.1",
4
4
  "description": "Support package for standalone Javascript applications",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -2,11 +2,13 @@ import Endpoint from './Endpoint.js'
2
2
 
3
3
  export default class Config extends Endpoint {
4
4
  async global({ stationIds = null, domains = null }) {
5
- return await this.requestData((r) => r.get('/config', { station_ids: stationIds, domains }))
5
+ return await this.requestData((r) => r.get('/config', this.withoutNullValues({ station_ids: stationIds, domains })))
6
6
  }
7
7
 
8
8
  async app(appId, { stationIds = null, domains = null }) {
9
- return await this.requestData((r) => r.get(`/config/${appId}`, { station_ids: stationIds, domains }))
9
+ return await this.requestData((r) =>
10
+ r.get(`/config/${appId}`, this.withoutNullValues({ station_ids: stationIds, domains }))
11
+ )
10
12
  }
11
13
 
12
14
  async updateSchema(appId, schema) {
@@ -55,4 +55,8 @@ export default class Endpoint {
55
55
 
56
56
  return new PaginatedResponse(response, key)
57
57
  }
58
+
59
+ withoutNullValues(object) {
60
+ return Object.fromEntries(Object.entries(object).filter(([, value]) => value !== null))
61
+ }
58
62
  }