Skip to content

Commit 81b34ec

Browse files
committed
refactor(webhooks): prefetch webhook deliveries in layout component
- Added a prefetch call for the latest webhook deliveries in the WebhookTabsLayout component, improving data retrieval efficiency. - This change enhances the user experience by ensuring that delivery data is readily available when the layout is rendered.
1 parent 87770d2 commit 81b34ec

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

  • src/app/dashboard/[teamSlug]/webhooks/[webhookId]/(tabs)

src/app/dashboard/[teamSlug]/webhooks/[webhookId]/(tabs)/layout.tsx

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@ export default async function WebhookTabsLayout({
2222
const { teamSlug, webhookId } = await params
2323

2424
prefetch(trpc.webhooks.get.queryOptions({ teamSlug, webhookId }))
25+
prefetch(
26+
trpc.webhooks.listDeliveries.queryOptions({ teamSlug, webhookId, limit: 1 })
27+
)
2528

2629
return (
2730
<HydrateClient>

0 commit comments

Comments
 (0)