nidus-sync/sync/radar.go

27 lines
714 B
Go
Raw Normal View History

2026-02-16 19:14:58 +00:00
package sync
import (
2026-02-17 22:50:16 +00:00
"context"
"net/http"
2026-02-16 19:14:58 +00:00
2026-02-17 22:50:16 +00:00
"github.com/Gleipnir-Technology/nidus-sync/db"
2026-02-16 19:14:58 +00:00
"github.com/Gleipnir-Technology/nidus-sync/db/models"
"github.com/Gleipnir-Technology/nidus-sync/html"
nhttp "github.com/Gleipnir-Technology/nidus-sync/http"
2026-02-16 19:14:58 +00:00
)
type contentRadar struct {
2026-02-17 22:50:16 +00:00
Organization *models.Organization
2026-02-16 19:14:58 +00:00
}
func getRadar(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*html.Response[contentRadar], *nhttp.ErrorWithStatus) {
2026-02-17 22:50:16 +00:00
org, err := user.Organization().One(ctx, db.PGInstance.BobDB)
2026-02-16 19:14:58 +00:00
if err != nil {
return nil, nhttp.NewError("get org: %w", err)
2026-02-16 19:14:58 +00:00
}
data := contentRadar{
2026-02-17 22:50:16 +00:00
Organization: org,
2026-02-16 19:14:58 +00:00
}
return html.NewResponse("sync/radar.html", data), nil
2026-02-16 19:14:58 +00:00
}