@axazure/pcf-proxy-dynamics 1.0.19 → 1.0.21

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 +8 -8
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -170,6 +170,11 @@ 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
+ if (!response.ok) {
174
+ const errorText = yield response.text();
175
+ res.status(response.status).json({ error: 'Error retrieving record', details: errorText });
176
+ return;
177
+ }
173
178
  const data = yield response.json();
174
179
  res.json(data);
175
180
  }
@@ -191,17 +196,12 @@ app.get('/api/data/v9.2/:entityType', (req, res) => __awaiter(void 0, void 0, vo
191
196
  method: 'GET',
192
197
  headers: _headers
193
198
  });
194
- console.log('Data retrieved : ' + JSON.stringify(response));
195
- const data = yield response;
196
- if (data == null) {
197
- res.status(500).json({ error: 'No data retrieved' });
198
- return;
199
- }
200
199
  if (!response.ok) {
201
- res.status(500).json({ error: 'Error retrieving records', details: response.statusText });
200
+ const errorText = yield response.text();
201
+ res.status(response.status).json({ error: 'Error retrieving records', details: errorText });
202
202
  return;
203
203
  }
204
- console.log('Data retrieved:', data);
204
+ const data = yield response.json();
205
205
  res.json(data);
206
206
  }));
207
207
  // 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.21",
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",