@axazure/pcf-proxy-dynamics 1.0.20 → 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 +6 -12
  2. package/package.json +1 -1
package/dist/server.js CHANGED
@@ -170,15 +170,12 @@ 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;
174
- if (data == null) {
175
- res.status(500).json({ error: 'No data retrieved' });
176
- return;
177
- }
178
173
  if (!response.ok) {
179
- res.status(500).json({ error: 'Error retrieving records', details: response.statusText });
174
+ const errorText = yield response.text();
175
+ res.status(response.status).json({ error: 'Error retrieving record', details: errorText });
180
176
  return;
181
177
  }
178
+ const data = yield response.json();
182
179
  res.json(data);
183
180
  }
184
181
  catch (error) {
@@ -199,15 +196,12 @@ app.get('/api/data/v9.2/:entityType', (req, res) => __awaiter(void 0, void 0, vo
199
196
  method: 'GET',
200
197
  headers: _headers
201
198
  });
202
- const data = yield response;
203
- if (data == null) {
204
- res.status(500).json({ error: 'No data retrieved' });
205
- return;
206
- }
207
199
  if (!response.ok) {
208
- 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 });
209
202
  return;
210
203
  }
204
+ const data = yield response.json();
211
205
  res.json(data);
212
206
  }));
213
207
  // Execute operation
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@axazure/pcf-proxy-dynamics",
3
- "version": "1.0.20",
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",