2026-02-16 19:14:58 +00:00
|
|
|
package sync
|
|
|
|
|
|
|
|
|
|
import (
|
2026-02-17 22:50:16 +00:00
|
|
|
"context"
|
2026-02-24 15:34:53 +00:00
|
|
|
"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"
|
2026-03-03 17:08:58 +00:00
|
|
|
"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
|
|
|
}
|
|
|
|
|
|
2026-03-03 17:08: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 {
|
2026-03-03 17:08:58 +00:00
|
|
|
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
|
|
|
}
|
2026-03-03 17:08:58 +00:00
|
|
|
return html.NewResponse("sync/radar.html", data), nil
|
2026-02-16 19:14:58 +00:00
|
|
|
}
|