Skip to content

Commit

Permalink
Allow importcontroller to return 200 for failed delete. (snipe#6034)
Browse files Browse the repository at this point in the history
  • Loading branch information
dmeltzer authored and snipe committed Aug 2, 2018
1 parent ffed306 commit 2637ce5
Show file tree
Hide file tree
Showing 13 changed files with 78 additions and 78 deletions.
2 changes: 1 addition & 1 deletion app/Http/Controllers/Api/ImportController.php
Original file line number Diff line number Diff line change
Expand Up @@ -174,7 +174,7 @@ public function destroy($import_id)
} catch (\Exception $e) {
// If the file delete didn't work, remove it from the database anyway and return a warning
$import->delete();
return response()->json(Helper::formatStandardApiResponse('warn', null, trans('admin/hardware/message.import.file_not_deleted_warning')), 500);
return response()->json(Helper::formatStandardApiResponse('warning', null, trans('admin/hardware/message.import.file_not_deleted_warning')));
}
}

Expand Down
2 changes: 1 addition & 1 deletion public/css/AdminLTE.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/AdminLTE.css.map

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions public/css/app.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/css/app.css.map

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/css/build/all.css

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions public/css/dist/all.css

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions public/js/build/all.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/build/vue.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion public/js/build/vue.js.map

Large diffs are not rendered by default.

52 changes: 26 additions & 26 deletions public/js/dist/all.js

Large diffs are not rendered by default.

20 changes: 10 additions & 10 deletions public/mix-manifest.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
{
"/js/build/vue.js": "/js/build/vue.js?id=1006a80af42fb7a2bf72",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=5e72463a66acbcc740d5",
"/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405",
"/js/build/vue.js": "/js/build/vue.js?id=f161c828ba87ea2a4f28",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=dc5078a783e6e5262b34",
"/css/app.css": "/css/app.css?id=c73d64eeb75c3c3a0b03",
"/css/overrides.css": "/css/overrides.css?id=66c5fceedf2c98cc310b",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=0f582cf76b3466f5acbe",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=0be7790b84909dca6a0a",
"/css/app.css.map": "/css/app.css.map?id=96b5c985e860716e6a16",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=564565889b611ca6fa71",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=6be7929500c3716cc827",
"/css/app.css.map": "/css/app.css.map?id=2d8fd3699fd3f6b8e8f5",
"/css/overrides.css.map": "/css/overrides.css.map?id=06e49ad87d99ddfd85d8",
"/css/dist/all.css": "/css/dist/all.css?id=4add7da3ad55822f239c",
"/js/dist/all.js": "/js/dist/all.js?id=2627d9bfc5e1f5552dc5",
"/css/build/all.css": "/css/build/all.css?id=4add7da3ad55822f239c",
"/js/build/all.js": "/js/build/all.js?id=2627d9bfc5e1f5552dc5"
"/css/dist/all.css": "/css/dist/all.css?id=1edf5f95ffd1fdb0ffb3",
"/js/dist/all.js": "/js/dist/all.js?id=924985144fa5bd4f9163",
"/css/build/all.css": "/css/build/all.css?id=1edf5f95ffd1fdb0ffb3",
"/js/build/all.js": "/js/build/all.js?id=924985144fa5bd4f9163"
}
6 changes: 3 additions & 3 deletions resources/assets/js/components/importer/importer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,13 @@
// Success, remove file from array.
(response) => {
this.files.splice(key, 1);
this.alert.type = "success";
this.alert.type = response.body.status; // A failed delete can still cause a 200 status code.
this.alert.visible = true;
this.alert.message = response.body.messages;
},
(response) => {// Fail
this.files.splice(key, 1);
this.alert.type="warning";
// this.files.splice(key, 1);
this.alert.type="error";
this.alert.visible=true;
this.alert.message=response.body.messages;
}
Expand Down

0 comments on commit 2637ce5

Please sign in to comment.