@objectstack/core 3.2.1 → 3.2.2

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/dist/index.js CHANGED
@@ -2316,8 +2316,8 @@ var HttpTestAdapter = class {
2316
2316
  return this.handleResponse(response);
2317
2317
  }
2318
2318
  async updateRecord(objectName, data, headers) {
2319
- const id = data._id || data.id;
2320
- if (!id) throw new Error("Update record requires _id or id in payload");
2319
+ const id = data.id;
2320
+ if (!id) throw new Error("Update record requires id in payload");
2321
2321
  const response = await fetch(`${this.baseUrl}/api/data/${objectName}/${id}`, {
2322
2322
  method: "PUT",
2323
2323
  headers,
@@ -2326,8 +2326,8 @@ var HttpTestAdapter = class {
2326
2326
  return this.handleResponse(response);
2327
2327
  }
2328
2328
  async deleteRecord(objectName, data, headers) {
2329
- const id = data._id || data.id;
2330
- if (!id) throw new Error("Delete record requires _id or id in payload");
2329
+ const id = data.id;
2330
+ if (!id) throw new Error("Delete record requires id in payload");
2331
2331
  const response = await fetch(`${this.baseUrl}/api/data/${objectName}/${id}`, {
2332
2332
  method: "DELETE",
2333
2333
  headers
@@ -2335,8 +2335,8 @@ var HttpTestAdapter = class {
2335
2335
  return this.handleResponse(response);
2336
2336
  }
2337
2337
  async readRecord(objectName, data, headers) {
2338
- const id = data._id || data.id;
2339
- if (!id) throw new Error("Read record requires _id or id in payload");
2338
+ const id = data.id;
2339
+ if (!id) throw new Error("Read record requires id in payload");
2340
2340
  const response = await fetch(`${this.baseUrl}/api/data/${objectName}/${id}`, {
2341
2341
  method: "GET",
2342
2342
  headers