Fix issue with the creation of comments that require approval
authorMarcel Werk <burntime@woltlab.com>
Fri, 27 Dec 2024 12:25:10 +0000 (13:25 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 27 Dec 2024 12:25:10 +0000 (13:25 +0100)
Closes #6150

ts/WoltLabSuite/Core/Component/Comment/List.ts
wcfsetup/install/files/js/WoltLabSuite/Core/Component/Comment/List.js

index c426f097bc2db8a34e68fa97cb004fb77893764b..f531810a694669ccd83936051a25e9578384327a 100644 (file)
@@ -352,11 +352,6 @@ class CommentList {
   async #loadCreatedComment(commentId: number): Promise<void> {
     const response = await renderComment(commentId);
     if (!response.ok) {
-      const validationError = response.error.getValidationError();
-      if (validationError === undefined) {
-        throw new Error("Unexpected validation error", { cause: response.error });
-      }
-
       return;
     }
 
@@ -374,11 +369,6 @@ class CommentList {
   async #loadCreatedResponse(commentId: number, responseId: number): Promise<void> {
     const response = await renderResponse(responseId);
     if (!response.ok) {
-      const validationError = response.error.getValidationError();
-      if (validationError === undefined) {
-        throw new Error("Unexpected validation error", { cause: response.error });
-      }
-
       return;
     }
 
index 1dac6b10b49f037c94c64e988f7f375e1be35b6d..d40eccf369375e5805e21c24253d80a9a65edf98 100644 (file)
@@ -257,10 +257,6 @@ define(["require", "exports", "tslib", "../../Dom/Change/Listener", "../../Dom/U
         async #loadCreatedComment(commentId) {
             const response = await (0, RenderComment_1.renderComment)(commentId);
             if (!response.ok) {
-                const validationError = response.error.getValidationError();
-                if (validationError === undefined) {
-                    throw new Error("Unexpected validation error", { cause: response.error });
-                }
                 return;
             }
             const referenceElement = this.#container.querySelector(".commentAdd").parentElement;
@@ -274,10 +270,6 @@ define(["require", "exports", "tslib", "../../Dom/Change/Listener", "../../Dom/U
         async #loadCreatedResponse(commentId, responseId) {
             const response = await (0, RenderResponse_1.renderResponse)(responseId);
             if (!response.ok) {
-                const validationError = response.error.getValidationError();
-                if (validationError === undefined) {
-                    throw new Error("Unexpected validation error", { cause: response.error });
-                }
                 return;
             }
             const item = this.#container.querySelector(`.commentList__item[data-comment-id="${commentId}"]`);