Shares #109
1 changed files with 9 additions and 0 deletions
|
@ -4,6 +4,7 @@ import (
|
||||||
"errors"
|
"errors"
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"slices"
|
||||||
|
|
||||||
"dynatron.me/x/stillbox/internal/forms"
|
"dynatron.me/x/stillbox/internal/forms"
|
||||||
"dynatron.me/x/stillbox/pkg/database"
|
"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)
|
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)
|
tgRes, err := tgs.TGs(ctx, idSl)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
wErr(w, r, autoError(err))
|
wErr(w, r, autoError(err))
|
||||||
|
|
Loading…
Add table
Reference in a new issue