summary refs log tree commit diff stats
path: root/svc/handlers.go
diff options
context:
space:
mode:
Diffstat (limited to 'svc/handlers.go')
-rw-r--r--svc/handlers.go26
1 files changed, 2 insertions, 24 deletions
diff --git a/svc/handlers.go b/svc/handlers.go
index 45f3022..7f7c730 100644
--- a/svc/handlers.go
+++ b/svc/handlers.go
@@ -5,7 +5,6 @@ import (
 	"fmt"
 	"net/http"
 	"strconv"
-	"strings"
 
 	"github.com/getwtxt/registry"
 	"github.com/gorilla/mux"
@@ -167,28 +166,7 @@ func apiTagsHandler(w http.ResponseWriter, r *http.Request) {
 	vars := mux.Vars(r)
 	tags := vars["tags"]
 
-	tags = strings.ToLower(tags)
-	out, err := twtxtCache.QueryInStatus("#" + tags)
-	if err != nil {
-		log500(w, r, err)
-		return
-	}
-	tags = strings.Title(tags)
-	out2, err := twtxtCache.QueryInStatus("#" + tags)
-	if err != nil {
-		log500(w, r, err)
-		return
-	}
-	tags = strings.ToUpper(tags)
-	out3, err := twtxtCache.QueryInStatus("#" + tags)
-	if err != nil {
-		log500(w, r, err)
-		return
-	}
-
-	out = append(out, out2...)
-	out = append(out, out3...)
-	out = uniq(out)
+	out := compositeStatusQuery("#"+tags, r)
 
 	out = registry.ReduceToPage(1, out)
 	data := parseQueryOut(out)
@@ -197,7 +175,7 @@ func apiTagsHandler(w http.ResponseWriter, r *http.Request) {
 	w.Header().Set("ETag", etag)
 	w.Header().Set("Content-Type", txtutf8)
 
-	_, err = w.Write(data)
+	_, err := w.Write(data)
 	if err != nil {
 		log500(w, r, err)
 		return