You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@answer.apache.org by li...@apache.org on 2024/04/26 02:26:59 UTC
(incubator-answer) 05/10: fix: move slugcheck to correct line
This is an automated email from the ASF dual-hosted git repository.
linkinstar pushed a commit to branch test
in repository https://gitbox.apache.org/repos/asf/incubator-answer.git
commit 056c5ce1cdadbe24355d4fe45bffe5517b35c539
Author: prithvidasgupta <pr...@umich.edu>
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