dce-reactkit 3.7.36 → 3.7.37

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": "dce-reactkit",
3
- "version": "3.7.36",
3
+ "version": "3.7.37",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -123,12 +123,24 @@ const visitServerEndpoint = async (
123
123
  );
124
124
  }
125
125
 
126
+ // Remove properties with undefined values
127
+ let params: { [key in string]: any } | undefined;
128
+ if (opts.params) {
129
+ params = Object.fromEntries(
130
+ Object
131
+ .entries(opts.params)
132
+ .filter(([key, value]) => {
133
+ return value !== undefined;
134
+ }),
135
+ );
136
+ }
137
+
126
138
  // Send the request
127
139
  const sendRequest = await getSendRequest();
128
140
  const response = await sendRequest({
129
141
  path: opts.path,
130
142
  method: opts.method ?? 'GET',
131
- params: opts.params,
143
+ params,
132
144
  });
133
145
 
134
146
  // Check for failure