2026-02-10 16:24:37 +00:00
|
|
|
package sync
|
|
|
|
|
|
|
|
|
|
import (
|
2026-02-24 15:34:53 +00:00
|
|
|
"context"
|
2026-02-10 16:24:37 +00:00
|
|
|
//"fmt"
|
|
|
|
|
"net/http"
|
|
|
|
|
//"strings"
|
|
|
|
|
//"time"
|
|
|
|
|
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/db/models"
|
|
|
|
|
"github.com/Gleipnir-Technology/nidus-sync/notification"
|
|
|
|
|
//"github.com/Gleipnir-Technology/bob"
|
|
|
|
|
//"github.com/Gleipnir-Technology/bob/dialect/psql"
|
|
|
|
|
//"github.com/Gleipnir-Technology/bob/dialect/psql/sm"
|
|
|
|
|
//"github.com/Gleipnir-Technology/nidus-sync/db"
|
|
|
|
|
//"github.com/Gleipnir-Technology/nidus-sync/db/sql"
|
|
|
|
|
//"github.com/google/uuid"
|
|
|
|
|
//"github.com/uber/h3-go/v4"
|
|
|
|
|
)
|
|
|
|
|
|
|
|
|
|
type contentNotificationList struct {
|
|
|
|
|
Notifications []notification.Notification
|
|
|
|
|
}
|
|
|
|
|
|
2026-02-24 15:34:53 +00:00
|
|
|
func getNotificationList(ctx context.Context, r *http.Request, org *models.Organization, u *models.User) (*response[contentNotificationList], *errorWithStatus) {
|
2026-02-10 16:24:37 +00:00
|
|
|
notifications, err := notification.ForUser(ctx, u)
|
|
|
|
|
if err != nil {
|
2026-02-24 15:34:53 +00:00
|
|
|
return nil, newError("Failed to get notifications: %w", err)
|
2026-02-10 16:24:37 +00:00
|
|
|
}
|
2026-02-24 15:34:53 +00:00
|
|
|
return newResponse("sync/notification-list.html", contentNotificationList{
|
2026-02-10 16:24:37 +00:00
|
|
|
Notifications: notifications,
|
2026-02-24 15:34:53 +00:00
|
|
|
}), nil
|
2026-02-10 16:24:37 +00:00
|
|
|
}
|