@malevich-studio/strapi-sdk-typescript 1.2.5 → 1.2.7

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
@@ -20101,7 +20101,7 @@ class Strapi {
20101
20101
  return this.token;
20102
20102
  }
20103
20103
  async baseLogin(identifier, password) {
20104
- const response = await this.fetchData('/auth/local', {
20104
+ const response = await this.fetchData('auth/local', {
20105
20105
  identifier,
20106
20106
  password
20107
20107
  }, {
@@ -20113,7 +20113,7 @@ class Strapi {
20113
20113
  return response;
20114
20114
  }
20115
20115
  async baseRegister(data) {
20116
- const response = await this.fetchData('/auth/local/register', data, {
20116
+ const response = await this.fetchData('auth/local/register', data, {
20117
20117
  method: 'POST',
20118
20118
  });
20119
20119
  if (!response.error) {
@@ -20122,7 +20122,7 @@ class Strapi {
20122
20122
  return response;
20123
20123
  }
20124
20124
  async forgotPassword(email) {
20125
- return await this.fetchData('/auth/forgot-password', { email }, {
20125
+ return await this.fetchData('auth/forgot-password', { email }, {
20126
20126
  method: 'POST',
20127
20127
  });
20128
20128
  }
@@ -20132,7 +20132,7 @@ class Strapi {
20132
20132
  });
20133
20133
  }
20134
20134
  async baseResetPassword(password, code) {
20135
- const response = await this.fetchData('/auth/reset-password', {
20135
+ const response = await this.fetchData('auth/reset-password', {
20136
20136
  password,
20137
20137
  passwordConfirmation: password,
20138
20138
  code,
@@ -20145,7 +20145,7 @@ class Strapi {
20145
20145
  return response;
20146
20146
  }
20147
20147
  async baseChangePassword(password, currentPassword) {
20148
- const response = await this.fetchData('/auth/change-password', {
20148
+ const response = await this.fetchData('auth/change-password', {
20149
20149
  password,
20150
20150
  passwordConfirmation: password,
20151
20151
  currentPassword,
@@ -20209,14 +20209,6 @@ class Strapi {
20209
20209
  }
20210
20210
  } : {}),
20211
20211
  }, params));
20212
- if (!response.ok) {
20213
- console.log(`${this.url}/api/${endpoint}`);
20214
- console.log(response);
20215
- const data = await response.json();
20216
- console.log(data);
20217
- console.log(data?.error?.details?.errors);
20218
- throw new Error(`Помилка запиту до Strapi: ${response.status} ${response.statusText}`);
20219
- }
20220
20212
  return (await response.json());
20221
20213
  }
20222
20214
  }