Fix empty object name in confirmation message
authorMarcel Werk <burntime@woltlab.com>
Tue, 10 Dec 2024 15:48:12 +0000 (16:48 +0100)
committerMarcel Werk <burntime@woltlab.com>
Tue, 10 Dec 2024 15:48:12 +0000 (16:48 +0100)
ts/WoltLabSuite/Core/Component/GridView/Action/Delete.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/GridView/Action/Delete.js

index e3a81d1ace0621bdba9600c68de9aacf42821ec0..ed32caade34d128ec18d28ebd6e9bae4a3c564cb 100644 (file)
@@ -3,7 +3,7 @@ import { confirmationFactory } from "../../Confirmation";
 import * as UiNotification from "WoltLabSuite/Core/Ui/Notification";
 
 async function handleDelete(row: HTMLTableRowElement, objectName: string, endpoint: string): Promise<void> {
-  const confirmationResult = await confirmationFactory().delete(objectName);
+  const confirmationResult = await confirmationFactory().delete(objectName ? objectName : undefined);
   if (!confirmationResult) {
     return;
   }
index 751f8ebc35eadee40c5b2f3223cd8672ec08ee19..f22c23f8c631783cb96210cfa6eef494afc0dd17 100644 (file)
@@ -4,7 +4,7 @@ define(["require", "exports", "tslib", "WoltLabSuite/Core/Api/DeleteObject", "..
     exports.setup = setup;
     UiNotification = tslib_1.__importStar(UiNotification);
     async function handleDelete(row, objectName, endpoint) {
-        const confirmationResult = await (0, Confirmation_1.confirmationFactory)().delete(objectName);
+        const confirmationResult = await (0, Confirmation_1.confirmationFactory)().delete(objectName ? objectName : undefined);
         if (!confirmationResult) {
             return;
         }