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

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

commit 4269a11c736368f90a0f1c94b6614b2758e910b1
Author: prithvidasgupta <[email protected]>
AuthorDate: Wed Apr 24 23:37:58 2024 -0400

    fix: move slugcheck to correct line
---
 internal/service/tag_common/tag_common.go | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/internal/service/tag_common/tag_common.go 
b/internal/service/tag_common/tag_common.go
index 467e3d65..1dfe4f7f 100644
--- a/internal/service/tag_common/tag_common.go
+++ b/internal/service/tag_common/tag_common.go
@@ -837,16 +837,18 @@ func (ts *TagCommonService) UpdateTag(ctx 
context.Context, req *schema.UpdateTag
        if !exist {
                return errors.BadRequest(reason.TagNotFound)
        }
+
+       //Adding equivalent slug formatting for tag update
+       slugName := strings.ReplaceAll(req.SlugName, " ", "-")
+       slugName = strings.ToLower(slugName)
+
        //If the content is the same, ignore it
        if tagInfo.OriginalText == req.OriginalText &&
                tagInfo.DisplayName == req.DisplayName &&
-               tagInfo.SlugName == req.SlugName {
+               tagInfo.SlugName == slugName {
                return nil
        }
 
-       //Adding equivalent slug formatting for tag update
-       slugName := strings.ReplaceAll(req.SlugName, " ", "-")
-       slugName = strings.ToLower(slugName)
        tagInfo.SlugName = slugName
        tagInfo.DisplayName = req.DisplayName
        tagInfo.OriginalText = req.OriginalText

Reply via email to