Skip to content

armgit / memos

Public Imported from GitHub
0

Memos is an open-source, self-hosted note-taking app that brings your everyday thoughts together in a personal timeline. Your data stays yours, and you choose what to keep private or share.

fix: remove duplicate tag (#450)

boojackbf07ab9e2fd3
diff --git a/server/tag.go b/server/tag.go
index 33f4a680d..a47e8a0e1 100644
--- a/server/tag.go
+++ b/server/tag.go
@@ -47,9 +47,15 @@ func (s *Server) registerTagRoutes(g *echo.Group) {
return echo.NewHTTPError(http.StatusInternalServerError, "Failed to find memo list").SetInternal(err)
}
- tagList := []string{}
+ tagMapSet := make(map[string]bool)
for _, memo := range memoList {
- tagList = append(tagList, findTagListFromMemoContent(memo.Content)...)
+ for _, tag := range findTagListFromMemoContent(memo.Content) {
+ tagMapSet[tag] = true
+ }
+ }
+ tagList := []string{}
+ for tag := range tagMapSet {
+ tagList = append(tagList, tag)
}
sort.Strings(tagList)