nidus-sync/sync/radar.go

24 lines
530 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"
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-17 22:50:16 +00:00
func getRadar(ctx context.Context, user *models.User) (string, contentRadar, *errorWithStatus) {
org, err := user.Organization().One(ctx, db.PGInstance.BobDB)
2026-02-16 19:14:58 +00:00
if err != nil {
2026-02-17 22:50:16 +00:00
return "", contentRadar{}, 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-17 22:50:16 +00:00
return "sync/radar.html", data, nil
2026-02-16 19:14:58 +00:00
}