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"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type contentRadar struct {
|
2026-02-17 22:50:16 +00:00
|
|
|
Organization *models.Organization
|
2026-02-16 19:14:58 +00:00
|
|
|
}
|
|
|
|
|
|
2026-02-24 15:34:53 +00:00
|
|
|
func getRadar(ctx context.Context, r *http.Request, org *models.Organization, user *models.User) (*response[contentRadar], *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-02-24 15:34:53 +00:00
|
|
|
return nil, 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-02-24 15:34:53 +00:00
|
|
|
return newResponse("sync/radar.html", data), nil
|
2026-02-16 19:14:58 +00:00
|
|
|
}
|