Add notification pagination to backend and frontend
This commit is contained in:
@@ -205,11 +205,15 @@ export async function deleteSubscription(subscriptionId: number): Promise<void>
|
||||
}
|
||||
}
|
||||
|
||||
// Get all subscription notifications
|
||||
// Get subscription notifications with pagination
|
||||
export async function fetchSubscriptionNotifications(
|
||||
subscriptionId: string
|
||||
subscriptionId: string,
|
||||
limit: number = 20,
|
||||
offset: number = 0
|
||||
): Promise<Notification[]> {
|
||||
const response = await fetch(`${API_URL}/subscriptions/${subscriptionId}/notifications`);
|
||||
const response = await fetch(
|
||||
`${API_URL}/subscriptions/${subscriptionId}/notifications?limit=${limit}&offset=${offset}`
|
||||
);
|
||||
if (!response.ok) {
|
||||
throw new Error('Failed to fetch subscription notifications');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user