@malevich-studio/strapi-sdk-typescript 1.2.21 → 1.2.23

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.cjs CHANGED
@@ -21409,6 +21409,12 @@ class Strapi {
21409
21409
  ...params,
21410
21410
  });
21411
21411
  }
21412
+ async updateBaseUser(endpoint, id, data, params = {}) {
21413
+ return await this.fetchData(`${endpoint}/${id}`, data, {
21414
+ method: 'PUT',
21415
+ ...params,
21416
+ });
21417
+ }
21412
21418
  async delete(endpoint, id, params = {}) {
21413
21419
  return await this.fetch(`${endpoint}/${id}`, {}, {
21414
21420
  method: 'DELETE',
@@ -21430,7 +21436,11 @@ class Strapi {
21430
21436
  } : {}),
21431
21437
  }, params);
21432
21438
  const response = await fetch(`${this.url}/api/${endpoint}`, mergedParams);
21433
- const data = await response.json();
21439
+ let data = null;
21440
+ try {
21441
+ data = await response?.json() || null;
21442
+ }
21443
+ catch (error) { }
21434
21444
  log(mergedParams);
21435
21445
  log(response);
21436
21446
  log(data);