File tree Expand file tree Collapse file tree 10 files changed +15
-15
lines changed Expand file tree Collapse file tree 10 files changed +15
-15
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ export default {
163
163
preConfirm: async () => {
164
164
try {
165
165
const res = await apiCall .makeCall (' DELETE' , ` 1/tokens/${ item .id } ` );
166
- if (res .status !== 200 ) {
166
+ if (res .status !== 200 && res . status !== 204 ) {
167
167
throw new Error (res);
168
168
}
169
169
@@ -187,7 +187,7 @@ export default {
187
187
name: this .editing .token .name ,
188
188
189
189
});
190
- if (res === undefined || res .status !== 200 ) {
190
+ if (res === undefined || res .status !== 200 && res . status !== 204 ) {
191
191
this .$swal (' Error' , ' Error while updating new token' , ' error' );
192
192
return ;
193
193
}
Original file line number Diff line number Diff line change @@ -155,7 +155,7 @@ export default {
155
155
preConfirm: async () => {
156
156
try {
157
157
const res = await apiCall .makeCall (' PUT' , ` 1/devices/${ item .id } ` );
158
- if (res .status !== 200 ) {
158
+ if (res .status !== 200 && res . status !== 204 ) {
159
159
throw new Error (res .statusText );
160
160
}
161
161
@@ -185,7 +185,7 @@ export default {
185
185
preConfirm: async () => {
186
186
try {
187
187
const res = await apiCall .makeCall (' DELETE' , ` 1/devices/${ item .id } ` );
188
- if (res .status !== 200 ) {
188
+ if (res .status !== 200 && res . status !== 204 ) {
189
189
throw new Error (res .statusText );
190
190
}
191
191
@@ -252,7 +252,7 @@ export default {
252
252
name: this .editItem .name
253
253
});
254
254
255
- if (res === undefined || res .status !== 200 ) {
255
+ if (res === undefined || res .status !== 200 && res . status !== 204 ) {
256
256
toastr .error (" Error while updating device" );
257
257
return ;
258
258
}
Original file line number Diff line number Diff line change @@ -162,7 +162,7 @@ export default {
162
162
preConfirm: async () => {
163
163
try {
164
164
const res = await apiCall .makeCall (' DELETE' , ` 1/shares/links/${ this .$route .params .id } /${ this .shocker .id } ` );
165
- if (res .status !== 200 ) {
165
+ if (res .status !== 200 && res . status !== 204 ) {
166
166
throw new Error (res .statusText );
167
167
}
168
168
Original file line number Diff line number Diff line change @@ -154,7 +154,7 @@ export default {
154
154
async addShockerAction () {
155
155
if (! this .validateAddShocker ) return ;
156
156
const res = await apiCall .makeCall (' POST' , ` 1/shares/links/${ this .id } /${ this .addShocker .selectedShocker } ` );
157
- if (res === undefined || res .status !== 200 ) {
157
+ if (res === undefined || res .status !== 200 && res . status !== 204 ) {
158
158
toastr .error (" Error while adding shocker to share link" );
159
159
return ;
160
160
}
Original file line number Diff line number Diff line change @@ -260,7 +260,7 @@ export default {
260
260
model: this .retrievedShocker .model
261
261
});
262
262
263
- if (res === undefined || res .status !== 200 ) {
263
+ if (res === undefined || res .status !== 200 && res . status !== 204 ) {
264
264
toastr .error (" Error while updating shocker" );
265
265
return ;
266
266
}
Original file line number Diff line number Diff line change @@ -199,7 +199,7 @@ export default {
199
199
preConfirm: async () => {
200
200
try {
201
201
const res = await apiCall .makeCall (' DELETE' , ` 1/shockers/${ this .shocker .id } ` );
202
- if (res .status !== 200 ) {
202
+ if (res .status !== 200 && res . status !== 204 ) {
203
203
throw new Error (res .statusText );
204
204
}
205
205
Original file line number Diff line number Diff line change @@ -280,7 +280,7 @@ export default {
280
280
preConfirm: async () => {
281
281
try {
282
282
const res = await apiCall .makeCall (' DELETE' , ` 1/shares/code/${ code .id } ` );
283
- if (res .status !== 200 ) {
283
+ if (res .status !== 200 && res . status !== 204 ) {
284
284
throw new Error (res);
285
285
}
286
286
@@ -319,7 +319,7 @@ export default {
319
319
preConfirm: async () => {
320
320
try {
321
321
const res = await apiCall .makeCall (' DELETE' , ` 1/shockers/${ this .$route .params .id } /shares/${ share .sharedWith .id } ` );
322
- if (res .status !== 200 ) {
322
+ if (res .status !== 200 && res . status !== 204 ) {
323
323
throw new Error (res);
324
324
}
325
325
@@ -358,7 +358,7 @@ export default {
358
358
intensity: temp .limitsTranslated .intensity == 100 ? null : temp .limitsTranslated .intensity
359
359
}
360
360
});
361
- if (res === undefined || res .status !== 200 ) {
361
+ if (res === undefined || res .status !== 200 && res . status !== 204 ) {
362
362
toastr .error (" Error while creating share code" );
363
363
return ;
364
364
}
Original file line number Diff line number Diff line change @@ -68,7 +68,7 @@ export default {
68
68
preConfirm: async (id ) => {
69
69
try {
70
70
const res = await apiCall .makeCall (' POST' , ` 1/shares/code/${ id} ` );
71
- if (res .status !== 200 ) {
71
+ if (res .status !== 200 && res . status !== 204 ) {
72
72
throw new Error (res .statusText );
73
73
}
74
74
} catch (err) {
Original file line number Diff line number Diff line change @@ -168,7 +168,7 @@ export default {
168
168
preConfirm: async () => {
169
169
try {
170
170
const res = await apiCall .makeCall (' DELETE' , ` 1/shockers/${ this .shocker .id } /shares/${ this .$store .state .user .id } ` );
171
- if (res .status !== 200 ) {
171
+ if (res .status !== 200 && res . status !== 204 ) {
172
172
throw new Error (res .statusText );
173
173
}
174
174
Original file line number Diff line number Diff line change @@ -33,7 +33,7 @@ export default {
33
33
34
34
try {
35
35
const res = await apiCall .makeCall (' POST' , ` 1/shares/code/${ this .id } ` );
36
- if (res .status !== 200 ) {
36
+ if (res .status !== 200 && res . status !== 204 ) {
37
37
throw new Error (res .statusText );
38
38
}
39
39
toastr .success (` Failed to add share: ${ utils .getError (err)} ` );
You can’t perform that action at this time.
0 commit comments