fixed notification system and added a new tenant notifications receipt table to track read status and filter messages by scope.
This commit is contained in:
@@ -74,8 +74,16 @@ function mapNotification(payload: GuestNotificationRow): GuestNotificationItem {
|
||||
};
|
||||
}
|
||||
|
||||
export async function fetchGuestNotifications(eventToken: string, etag?: string | null): Promise<GuestNotificationFetchResult> {
|
||||
const response = await fetch(`/api/v1/events/${encodeURIComponent(eventToken)}/notifications`, {
|
||||
export async function fetchGuestNotifications(
|
||||
eventToken: string,
|
||||
etag?: string | null,
|
||||
options?: { status?: 'unread' | 'read' | 'dismissed'; scope?: 'all' | 'uploads' | 'tips' | 'general' }
|
||||
): Promise<GuestNotificationFetchResult> {
|
||||
const params = new URLSearchParams();
|
||||
if (options?.status) params.set('status', options.status);
|
||||
if (options?.scope && options.scope !== 'all') params.set('scope', options.scope);
|
||||
|
||||
const response = await fetch(`/api/v1/events/${encodeURIComponent(eventToken)}/notifications${params.toString() ? `?${params.toString()}` : ''}`, {
|
||||
method: 'GET',
|
||||
headers: buildHeaders(etag),
|
||||
credentials: 'include',
|
||||
|
||||
Reference in New Issue
Block a user