@axazure/pcf-proxy-dynamics 1.0.19 → 1.0.20

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.
Files changed (2) hide show
  1. package/dist/server.js +9 -3
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -170,7 +170,15 @@ app.get('/api/data/v9.2/:entityType\\(:id\\)', (req, res) => __awaiter(void 0, v
170
170
  method: 'GET',
171
171
  headers: _headers
172
172
  });
173
- const data = yield response.json();
173
+ const data = yield response;
174
+ if (data == null) {
175
+ res.status(500).json({ error: 'No data retrieved' });
176
+ return;
177
+ }
178
+ if (!response.ok) {
179
+ res.status(500).json({ error: 'Error retrieving records', details: response.statusText });
180
+ return;
181
+ }
174
182
  res.json(data);
175
183
  }
176
184
  catch (error) {
@@ -191,7 +199,6 @@ app.get('/api/data/v9.2/:entityType', (req, res) => __awaiter(void 0, void 0, vo
191
199
  method: 'GET',
192
200
  headers: _headers
193
201
  });
194
- console.log('Data retrieved : ' + JSON.stringify(response));
195
202
  const data = yield response;
196
203
  if (data == null) {
197
204
  res.status(500).json({ error: 'No data retrieved' });
@@ -201,7 +208,6 @@ app.get('/api/data/v9.2/:entityType', (req, res) => __awaiter(void 0, void 0, vo
201
208
  res.status(500).json({ error: 'Error retrieving records', details: response.statusText });
202
209
  return;
203
210
  }
204
- console.log('Data retrieved:', data);
205
211
  res.json(data);
206
212
  }));
207
213
  // Execute operation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axazure/pcf-proxy-dynamics",
3
- "version": "1.0.19",
3
+ "version": "1.0.20",
4
4
  "description": "Backend allowing PCF components to access Dynamics 365 data",
5
5
  "main": "dist/WebApiProxy.js",
6
6
  "types": "dist/WebApiProxy.d.ts",