Skip to content

Commit a58e480

Browse files
committed
Re-enable webhooks sidebar link in project dashboard
1 parent e8a25d7 commit a58e480

File tree

2 files changed

+33
-27
lines changed

2 files changed

+33
-27
lines changed

apps/dashboard/src/@/api/insight/webhooks.ts

Lines changed: 22 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -73,15 +73,18 @@ export async function createWebhook(
7373
): Promise<WebhookSingleResponse> {
7474
try {
7575
const authToken = await getAuthToken();
76-
const response = await fetch(`${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`, {
77-
method: "POST",
78-
headers: {
79-
"Content-Type": "application/json",
80-
"x-client-id": clientId,
81-
Authorization: `Bearer ${authToken}`,
76+
const response = await fetch(
77+
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`,
78+
{
79+
method: "POST",
80+
headers: {
81+
"Content-Type": "application/json",
82+
"x-client-id": clientId,
83+
Authorization: `Bearer ${authToken}`,
84+
},
85+
body: JSON.stringify(payload),
8286
},
83-
body: JSON.stringify(payload),
84-
});
87+
);
8588

8689
if (!response.ok) {
8790
const errorText = await response.text();
@@ -105,13 +108,16 @@ export async function getWebhooks(
105108
): Promise<WebhooksListResponse> {
106109
try {
107110
const authToken = await getAuthToken();
108-
const response = await fetch(`${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`, {
109-
method: "GET",
110-
headers: {
111-
"x-client-id": clientId,
112-
Authorization: `Bearer ${authToken}`,
111+
const response = await fetch(
112+
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks`,
113+
{
114+
method: "GET",
115+
headers: {
116+
"x-client-id": clientId,
117+
Authorization: `Bearer ${authToken}`,
118+
},
113119
},
114-
});
120+
);
115121

116122
if (!response.ok) {
117123
const errorText = await response.text();
@@ -137,7 +143,7 @@ export async function deleteWebhook(
137143
try {
138144
const authToken = await getAuthToken();
139145
const response = await fetch(
140-
`${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/${encodeURIComponent(webhookId)}`,
146+
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/${encodeURIComponent(webhookId)}`,
141147
{
142148
method: "DELETE",
143149
headers: {
@@ -171,7 +177,7 @@ export async function testWebhook(
171177
try {
172178
const authToken = await getAuthToken();
173179
const response = await fetch(
174-
`${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/test`,
180+
`https://${THIRDWEB_INSIGHT_API_DOMAIN}/v1/webhooks/test`,
175181
{
176182
method: "POST",
177183
headers: {

apps/dashboard/src/app/(app)/team/[team_slug]/[project_slug]/(sidebar)/components/ProjectSidebarLayout.tsx

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
import { FullWidthSidebarLayout } from "@/components/blocks/SidebarLayout";
33
import { Badge } from "@/components/ui/badge";
44
import {
5+
BellIcon,
56
BookTextIcon,
67
BoxIcon,
78
CoinsIcon,
@@ -94,17 +95,16 @@ export function ProjectSidebarLayout(props: {
9495
icon: NebulaIcon,
9596
tracking: tracking("nebula"),
9697
},
97-
// Commented until we solve the scrolling issue
98-
// {
99-
// href: `${layoutPath}/webhooks`,
100-
// label: (
101-
// <span className="flex items-center gap-2">
102-
// Webhooks <Badge>New</Badge>
103-
// </span>
104-
// ),
105-
// icon: BellIcon,
106-
// tracking: tracking("webhooks"),
107-
// },
98+
{
99+
href: `${layoutPath}/webhooks`,
100+
label: (
101+
<span className="flex items-center gap-2">
102+
Webhooks <Badge>New</Badge>
103+
</span>
104+
),
105+
icon: BellIcon,
106+
tracking: tracking("webhooks"),
107+
},
108108
]}
109109
footerSidebarLinks={[
110110
{

0 commit comments

Comments
 (0)