Allow importcontroller to return 200 for failed delete. (#6034)

This commit is contained in:
Daniel Meltzer 2018-08-02 12:53:54 -04:00 committed by snipe
parent ffed306ecd
commit 2637ce56a1
13 changed files with 14 additions and 14 deletions

View file

@ -174,7 +174,7 @@ class ImportController extends Controller
} catch (\Exception $e) { } catch (\Exception $e) {
// If the file delete didn't work, remove it from the database anyway and return a warning // If the file delete didn't work, remove it from the database anyway and return a warning
$import->delete(); $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')));
} }
} }

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

BIN
public/js/dist/all.js vendored

Binary file not shown.

View file

@ -1,14 +1,14 @@
{ {
"/js/build/vue.js": "/js/build/vue.js?id=1006a80af42fb7a2bf72", "/js/build/vue.js": "/js/build/vue.js?id=f161c828ba87ea2a4f28",
"/css/AdminLTE.css": "/css/AdminLTE.css?id=5e72463a66acbcc740d5", "/css/AdminLTE.css": "/css/AdminLTE.css?id=dc5078a783e6e5262b34",
"/css/app.css": "/css/app.css?id=407edb63cc6b6dc62405", "/css/app.css": "/css/app.css?id=c73d64eeb75c3c3a0b03",
"/css/overrides.css": "/css/overrides.css?id=66c5fceedf2c98cc310b", "/css/overrides.css": "/css/overrides.css?id=66c5fceedf2c98cc310b",
"/js/build/vue.js.map": "/js/build/vue.js.map?id=0f582cf76b3466f5acbe", "/js/build/vue.js.map": "/js/build/vue.js.map?id=564565889b611ca6fa71",
"/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=0be7790b84909dca6a0a", "/css/AdminLTE.css.map": "/css/AdminLTE.css.map?id=6be7929500c3716cc827",
"/css/app.css.map": "/css/app.css.map?id=96b5c985e860716e6a16", "/css/app.css.map": "/css/app.css.map?id=2d8fd3699fd3f6b8e8f5",
"/css/overrides.css.map": "/css/overrides.css.map?id=06e49ad87d99ddfd85d8", "/css/overrides.css.map": "/css/overrides.css.map?id=06e49ad87d99ddfd85d8",
"/css/dist/all.css": "/css/dist/all.css?id=4add7da3ad55822f239c", "/css/dist/all.css": "/css/dist/all.css?id=1edf5f95ffd1fdb0ffb3",
"/js/dist/all.js": "/js/dist/all.js?id=2627d9bfc5e1f5552dc5", "/js/dist/all.js": "/js/dist/all.js?id=924985144fa5bd4f9163",
"/css/build/all.css": "/css/build/all.css?id=4add7da3ad55822f239c", "/css/build/all.css": "/css/build/all.css?id=1edf5f95ffd1fdb0ffb3",
"/js/build/all.js": "/js/build/all.js?id=2627d9bfc5e1f5552dc5" "/js/build/all.js": "/js/build/all.js?id=924985144fa5bd4f9163"
} }

View file

@ -90,13 +90,13 @@
// Success, remove file from array. // Success, remove file from array.
(response) => { (response) => {
this.files.splice(key, 1); 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.visible = true;
this.alert.message = response.body.messages; this.alert.message = response.body.messages;
}, },
(response) => {// Fail (response) => {// Fail
this.files.splice(key, 1); // this.files.splice(key, 1);
this.alert.type="warning"; this.alert.type="error";
this.alert.visible=true; this.alert.visible=true;
this.alert.message=response.body.messages; this.alert.message=response.body.messages;
} }