Skip to content

Commit

Permalink
small tweaks
Browse files Browse the repository at this point in the history
  • Loading branch information
steven-tey committed Jan 12, 2025
1 parent ea791d6 commit 392163c
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
10 changes: 2 additions & 8 deletions apps/web/app/api/webhooks/route.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,11 @@ export const GET = withWorkspace(
installationId: true,
},
orderBy: {
updatedAt: "desc",
createdAt: "desc",
},
});

// Make sure the user webhook is always at the top
const sortedWebhooks = webhooks.sort(
(a, b) =>
(b.receiver === "user" ? 1 : 0) - (a.receiver === "user" ? 1 : 0),
);

return NextResponse.json(sortedWebhooks.map(transformWebhook));
return NextResponse.json(webhooks.map(transformWebhook));
},
{
requiredPermissions: ["webhooks.read"],
Expand Down
3 changes: 1 addition & 2 deletions apps/web/ui/webhooks/webhook-header.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -95,12 +95,11 @@ export default function WebhookHeader({ webhookId }: { webhookId: string }) {
{isLoading || !webhook ? (
<div className="flex flex-col gap-3 sm:flex-row sm:items-center">
<div className="w-fit flex-none rounded-md border border-gray-200 bg-gradient-to-t from-gray-100 p-2">
<TokenAvatar id="placeholder-oauth-app" className="size-8" />
<div className="size-8 rounded-full bg-gray-100" />
</div>
<div className="flex flex-col gap-2">
<div className="h-5 w-28 rounded-full bg-gray-100"></div>
<div className="h-3 w-48 rounded-full bg-gray-100"></div>
<div className="h-3 w-40 rounded-full bg-gray-100"></div>
</div>
</div>
) : (
Expand Down
6 changes: 3 additions & 3 deletions apps/web/ui/webhooks/webhook-placeholder.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ export default function WebhookPlaceholder() {
return (
<div className="relative grid gap-4 rounded-xl border border-gray-200 bg-white px-5 py-4">
<div className="flex items-center gap-2">
<div className="flex h-10 w-10 items-center justify-center rounded bg-gray-100" />
<div className="flex flex-col gap-1">
<div className="h-3 w-20 rounded-full bg-gray-100"></div>
<div className="flex size-12 items-center justify-center rounded-lg bg-gray-100" />
<div className="flex flex-col gap-2">
<div className="h-4 w-20 rounded-full bg-gray-100"></div>
<div className="h-3 w-28 rounded-full bg-gray-100"></div>
</div>
</div>
Expand Down

0 comments on commit 392163c

Please sign in to comment.