Skip to content

Commit 2a4195b

Browse files
authored
chore: pass authToken to analytics query (#7306)
1 parent 6378f37 commit 2a4195b

File tree

1 file changed

+1
-30
lines changed

1 file changed

+1
-30
lines changed

apps/dashboard/src/@/api/analytics.ts

Lines changed: 1 addition & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@ async function fetchAnalytics(
2222
init?: RequestInit,
2323
): Promise<Response> {
2424
const token = await getAuthToken();
25-
2625
if (!token) {
2726
throw new Error("You are not authorized to perform this action");
2827
}
@@ -48,22 +47,11 @@ async function fetchAnalytics(
4847
decodeURIComponent(value),
4948
);
5049
}
51-
// client id DEBUG OVERRIDE
52-
// analyticsServiceUrl.searchParams.delete("projectId");
53-
// analyticsServiceUrl.searchParams.delete("teamId");
54-
// analyticsServiceUrl.searchParams.append(
55-
// "teamId",
56-
// "team_cm0lde33r02344w129k5hm2xz",
57-
// );
58-
// analyticsServiceUrl.searchParams.append(
59-
// "projectId",
60-
// "prj_cm4rqwx9b002qrnsnr37wqpo6",
61-
// );
6250

6351
return fetch(analyticsServiceUrl, {
6452
...init,
6553
headers: {
66-
"content-type": "application/json",
54+
Authorization: `Bearer ${token}`,
6755
...init?.headers,
6856
},
6957
});
@@ -99,7 +87,6 @@ export async function getWalletConnections(
9987
`v2/sdk/wallet-connects?${searchParams.toString()}`,
10088
{
10189
method: "GET",
102-
headers: { "Content-Type": "application/json" },
10390
},
10491
);
10592

@@ -123,7 +110,6 @@ export async function getInAppWalletUsage(
123110
`v2/wallet/connects?${searchParams.toString()}`,
124111
{
125112
method: "GET",
126-
headers: { "Content-Type": "application/json" },
127113
},
128114
);
129115

@@ -147,7 +133,6 @@ export async function getUserOpUsage(
147133
`v2/bundler/usage?${searchParams.toString()}`,
148134
{
149135
method: "GET",
150-
headers: { "Content-Type": "application/json" },
151136
},
152137
);
153138

@@ -205,7 +190,6 @@ export async function getClientTransactions(
205190
`v2/sdk/contract-transactions?${searchParams.toString()}`,
206191
{
207192
method: "GET",
208-
headers: { "Content-Type": "application/json" },
209193
},
210194
);
211195

@@ -229,7 +213,6 @@ export async function getRpcMethodUsage(
229213
`v2/rpc/evm-methods?${searchParams.toString()}`,
230214
{
231215
method: "GET",
232-
headers: { "Content-Type": "application/json" },
233216
},
234217
);
235218

@@ -250,7 +233,6 @@ export async function getWalletUsers(
250233
`v2/sdk/wallet-connects/users?${searchParams.toString()}`,
251234
{
252235
method: "GET",
253-
headers: { "Content-Type": "application/json" },
254236
},
255237
);
256238

@@ -287,7 +269,6 @@ export async function isProjectActive(params: {
287269
`v2/active-usage?${searchParams.toString()}`,
288270
{
289271
method: "GET",
290-
headers: { "Content-Type": "application/json" },
291272
},
292273
);
293274

@@ -357,9 +338,6 @@ export async function getEcosystemWalletUsage(args: {
357338
`v2/wallet/connects?${searchParams.toString()}`,
358339
{
359340
method: "GET",
360-
headers: {
361-
"Content-Type": "application/json",
362-
},
363341
},
364342
);
365343

@@ -386,9 +364,6 @@ export async function getUniversalBridgeUsage(args: {
386364
const searchParams = buildSearchParams(args);
387365
const res = await fetchAnalytics(`v2/universal?${searchParams.toString()}`, {
388366
method: "GET",
389-
headers: {
390-
"Content-Type": "application/json",
391-
},
392367
});
393368

394369
if (res?.status !== 200) {
@@ -415,9 +390,6 @@ export async function getUniversalBridgeWalletUsage(args: {
415390
`v2/universal/wallets?${searchParams.toString()}`,
416391
{
417392
method: "GET",
418-
headers: {
419-
"Content-Type": "application/json",
420-
},
421393
},
422394
);
423395

@@ -441,7 +413,6 @@ export async function getEngineCloudMethodUsage(
441413
`v2/engine-cloud/requests?${searchParams.toString()}`,
442414
{
443415
method: "GET",
444-
headers: { "Content-Type": "application/json" },
445416
},
446417
);
447418

0 commit comments

Comments
 (0)