easycomponentstools 1.0.0-dev.16 → 1.0.0-dev.17

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/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "easycomponentstools",
3
3
  "private": false,
4
- "version": "1.0.0-dev.16",
4
+ "version": "1.0.0-dev.17",
5
5
  "type": "module",
6
6
  "description": "Easy Vue Components",
7
7
  "keywords": [
@@ -150,8 +150,10 @@ const deletion = (id: string | number) => {
150
150
  })
151
151
  .then(async (response) => {
152
152
  if (!response.ok) {
153
- const err = await response.json()
154
- return await Promise.reject(err)
153
+ throw {
154
+ statusCode: response.status,
155
+ data: await response.json(),
156
+ }
155
157
  }
156
158
  return response.json()
157
159
  })
@@ -173,8 +175,10 @@ const multipleDelete = () => {
173
175
  })
174
176
  .then(async (response) => {
175
177
  if (!response.ok) {
176
- const err = await response.json()
177
- return await Promise.reject(err)
178
+ throw {
179
+ statusCode: response.status,
180
+ data: await response.json(),
181
+ }
178
182
  }
179
183
  return response.json()
180
184
  })
@@ -201,8 +205,10 @@ const getData = async () => {
201
205
  fetch(`${props.api.get}?${params}`, { method: 'GET' })
202
206
  .then(async (response) => {
203
207
  if (!response.ok) {
204
- const err = await response.json()
205
- return await Promise.reject(err)
208
+ throw {
209
+ statusCode: response.status,
210
+ data: await response.json(),
211
+ }
206
212
  }
207
213
  return response.json()
208
214
  })