Proper handling of a 204 response
authorAlexander Ebert <ebert@woltlab.com>
Mon, 16 May 2022 09:25:55 +0000 (11:25 +0200)
committerAlexander Ebert <ebert@woltlab.com>
Mon, 16 May 2022 09:25:55 +0000 (11:25 +0200)
ts/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Acp/Ui/DataImport/Manager.js

index 277fe38805dc216d90c00f72e9a60a2e3f85fcb5..280aabc2d7134a9dc6fb00a75e43a4100e46ecf7 100644 (file)
@@ -10,7 +10,7 @@
 import * as Ajax from "../../../Ajax";
 import * as Core from "../../../Core";
 import * as Language from "../../../Language";
-import { AjaxCallbackObject, AjaxCallbackSetup, ResponseData } from "../../../Ajax/Data";
+import { AjaxCallbackObject, AjaxCallbackSetup } from "../../../Ajax/Data";
 import { AjaxResponse } from "../../../Controller/Clipboard/Data";
 import { DialogCallbackSetup } from "../../../Ui/Dialog/Data";
 import DomUtil from "../../../Dom/Util";
@@ -38,15 +38,7 @@ export class AcpUiDataImportManager implements AjaxCallbackObject {
           noRedirect: 1,
         },
         silent: true,
-        failure: (_data: ResponseData, _responseText: string, xhr: XMLHttpRequest) => {
-          if (xhr.status === 204) {
-            this.showCompletedDialog();
-
-            return false;
-          }
-
-          return true;
-        },
+        success: () => this.showCompletedDialog(),
       });
     } else {
       this.run(Language.get("wcf.acp.dataImport.data." + this.queue[this.index]), this.queue[this.index]);
index 630bb7e66a786c3bbb068afeca71a10e946d0045..71dc369ea192643ab02d69afc4bd2d2f79c9b0ec 100644 (file)
@@ -24,13 +24,7 @@ define(["require", "exports", "tslib", "../../../Ajax", "../../../Core", "../../
                         noRedirect: 1,
                     },
                     silent: true,
-                    failure: (_data, _responseText, xhr) => {
-                        if (xhr.status === 204) {
-                            this.showCompletedDialog();
-                            return false;
-                        }
-                        return true;
-                    },
+                    success: () => this.showCompletedDialog(),
                 });
             }
             else {