Skip to content

Commit 99e9f5b

Browse files
committed
204 is fine for a status code
1 parent c4f8a0c commit 99e9f5b

File tree

10 files changed

+15
-15
lines changed

10 files changed

+15
-15
lines changed

src/views/dashboard/ApiTokens/ApiTokenRoot.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -163,7 +163,7 @@ export default {
163163
preConfirm: async () => {
164164
try {
165165
const res = await apiCall.makeCall('DELETE', `1/tokens/${item.id}`);
166-
if (res.status !== 200) {
166+
if (res.status !== 200 && res.status !== 204) {
167167
throw new Error(res);
168168
}
169169
@@ -187,7 +187,7 @@ export default {
187187
name: this.editing.token.name,
188188
189189
});
190-
if (res === undefined || res.status !== 200) {
190+
if (res === undefined || res.status !== 200 && res.status !== 204) {
191191
this.$swal('Error', 'Error while updating new token', 'error');
192192
return;
193193
}

src/views/dashboard/devices/DevicesRoot.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -155,7 +155,7 @@ export default {
155155
preConfirm: async () => {
156156
try {
157157
const res = await apiCall.makeCall('PUT', `1/devices/${item.id}`);
158-
if (res.status !== 200) {
158+
if (res.status !== 200 && res.status !== 204) {
159159
throw new Error(res.statusText);
160160
}
161161
@@ -185,7 +185,7 @@ export default {
185185
preConfirm: async () => {
186186
try {
187187
const res = await apiCall.makeCall('DELETE', `1/devices/${item.id}`);
188-
if (res.status !== 200) {
188+
if (res.status !== 200 && res.status !== 204) {
189189
throw new Error(res.statusText);
190190
}
191191
@@ -252,7 +252,7 @@ export default {
252252
name: this.editItem.name
253253
});
254254
255-
if (res === undefined || res.status !== 200) {
255+
if (res === undefined || res.status !== 200 && res.status !== 204) {
256256
toastr.error("Error while updating device");
257257
return;
258258
}

src/views/dashboard/shares/links/ShareLinkShocker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -162,7 +162,7 @@ export default {
162162
preConfirm: async () => {
163163
try {
164164
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) {
166166
throw new Error(res.statusText);
167167
}
168168

src/views/dashboard/shares/links/ViewShareLink.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ export default {
154154
async addShockerAction() {
155155
if (!this.validateAddShocker) return;
156156
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) {
158158
toastr.error("Error while adding shocker to share link");
159159
return;
160160
}

src/views/dashboard/shockers/own/Own.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,7 @@ export default {
260260
model: this.retrievedShocker.model
261261
});
262262
263-
if (res === undefined || res.status !== 200) {
263+
if (res === undefined || res.status !== 200 && res.status !== 204) {
264264
toastr.error("Error while updating shocker");
265265
return;
266266
}

src/views/dashboard/shockers/own/OwnShocker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ export default {
199199
preConfirm: async () => {
200200
try {
201201
const res = await apiCall.makeCall('DELETE', `1/shockers/${this.shocker.id}`);
202-
if (res.status !== 200) {
202+
if (res.status !== 200 && res.status !== 204) {
203203
throw new Error(res.statusText);
204204
}
205205

src/views/dashboard/shockers/own/shares/ShockerSharesRoot.vue

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -280,7 +280,7 @@ export default {
280280
preConfirm: async () => {
281281
try {
282282
const res = await apiCall.makeCall('DELETE', `1/shares/code/${code.id}`);
283-
if (res.status !== 200) {
283+
if (res.status !== 200 && res.status !== 204) {
284284
throw new Error(res);
285285
}
286286
@@ -319,7 +319,7 @@ export default {
319319
preConfirm: async () => {
320320
try {
321321
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) {
323323
throw new Error(res);
324324
}
325325
@@ -358,7 +358,7 @@ export default {
358358
intensity: temp.limitsTranslated.intensity == 100 ? null : temp.limitsTranslated.intensity
359359
}
360360
});
361-
if (res === undefined || res.status !== 200) {
361+
if (res === undefined || res.status !== 200 && res.status !== 204) {
362362
toastr.error("Error while creating share code");
363363
return;
364364
}

src/views/dashboard/shockers/shared/Shared.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export default {
6868
preConfirm: async (id) => {
6969
try {
7070
const res = await apiCall.makeCall('POST', `1/shares/code/${id}`);
71-
if (res.status !== 200) {
71+
if (res.status !== 200 && res.status !== 204) {
7272
throw new Error(res.statusText);
7373
}
7474
} catch (err) {

src/views/dashboard/shockers/shared/SharedShocker.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -168,7 +168,7 @@ export default {
168168
preConfirm: async () => {
169169
try {
170170
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) {
172172
throw new Error(res.statusText);
173173
}
174174

src/views/public/proxy/ShareCodeProxy.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ export default {
3333
3434
try {
3535
const res = await apiCall.makeCall('POST', `1/shares/code/${this.id}`);
36-
if (res.status !== 200) {
36+
if (res.status !== 200 && res.status !== 204) {
3737
throw new Error(res.statusText);
3838
}
3939
toastr.success(`Failed to add share: ${utils.getError(err)}`);

0 commit comments

Comments
 (0)