You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by sh...@apache.org on 2024/07/25 02:27:27 UTC

(incubator-answer) branch test updated: fix: remove spaces in file.attributes.tags

This is an automated email from the ASF dual-hosted git repository.

shuai pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git


The following commit(s) were added to refs/heads/test by this push:
     new 0668b4f2 fix: remove spaces in file.attributes.tags
0668b4f2 is described below

commit 0668b4f255fcad4878961c615954772e924a78d0
Author: shuai <li...@sifou.com>
AuthorDate: Thu Jul 25 10:22:37 2024 +0800

    fix: remove spaces in file.attributes.tags
---
 ui/src/pages/Questions/Ask/index.tsx | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/ui/src/pages/Questions/Ask/index.tsx b/ui/src/pages/Questions/Ask/index.tsx
index fe6afd69..149373ed 100644
--- a/ui/src/pages/Questions/Ask/index.tsx
+++ b/ui/src/pages/Questions/Ask/index.tsx
@@ -148,7 +148,12 @@ const Ask = () => {
           formData.title.value = file.attributes?.title;
           formData.content.value = file.body;
           if (!queryTags && file.attributes?.tags) {
-            updateTags(file.attributes.tags);
+            // Remove spaces in file.attributes.tags
+            const filterTags = file.attributes.tags
+              .split(',')
+              .map((tag) => tag.trim())
+              .join(',');
+            updateTags(filterTags);
           }
         } else if (draft) {
           formData.title.value = draft.title;