nidus-sync/sync/notification.go

34 lines
1,006 B
Go
Raw Normal View History

2026-02-10 16:24:37 +00:00
package sync
import (
"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
}
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 {
return nil, newError("Failed to get notifications: %w", err)
2026-02-10 16:24:37 +00:00
}
return newResponse("sync/notification-list.html", contentNotificationList{
2026-02-10 16:24:37 +00:00
Notifications: notifications,
}), nil
2026-02-10 16:24:37 +00:00
}