This commit is contained in:
Daniel Ponte 2025-02-07 17:01:17 -05:00
parent e5772ae2ce
commit 9b55805acd

View file

@ -4,6 +4,7 @@ import (
"errors"
"fmt"
"net/http"
"slices"
"dynatron.me/x/stillbox/internal/forms"
"dynatron.me/x/stillbox/pkg/database"
@ -181,6 +182,14 @@ func (tga *talkgroupAPI) getTGsShareRoute(_ ID, w http.ResponseWriter, r *http.R
idSl = append(idSl, id)
}
slices.SortFunc(idSl, func(a, b talkgroups.ID) int {
if d := int(a.System) - int(b.System); d != 0 {
return d
}
return int(a.Talkgroup) - int(b.Talkgroup)
})
tgRes, err := tgs.TGs(ctx, idSl)
if err != nil {
wErr(w, r, autoError(err))