Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 1 addition & 30 deletions apps/dashboard/src/@/api/analytics.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ async function fetchAnalytics(
init?: RequestInit,
): Promise<Response> {
const token = await getAuthToken();

if (!token) {
throw new Error("You are not authorized to perform this action");
}
Expand All @@ -48,22 +47,11 @@ async function fetchAnalytics(
decodeURIComponent(value),
);
}
// client id DEBUG OVERRIDE
// analyticsServiceUrl.searchParams.delete("projectId");
// analyticsServiceUrl.searchParams.delete("teamId");
// analyticsServiceUrl.searchParams.append(
// "teamId",
// "team_cm0lde33r02344w129k5hm2xz",
// );
// analyticsServiceUrl.searchParams.append(
// "projectId",
// "prj_cm4rqwx9b002qrnsnr37wqpo6",
// );

return fetch(analyticsServiceUrl, {
...init,
headers: {
"content-type": "application/json",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Analytics-service only has GET queries. No content-type header is needed.

Authorization: `Bearer ${token}`,
...init?.headers,
},
});
Expand Down Expand Up @@ -99,7 +87,6 @@ export async function getWalletConnections(
`v2/sdk/wallet-connects?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);

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

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

Expand Down Expand Up @@ -205,7 +190,6 @@ export async function getClientTransactions(
`v2/sdk/contract-transactions?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);

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

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

Expand Down Expand Up @@ -287,7 +269,6 @@ export async function isProjectActive(params: {
`v2/active-usage?${searchParams.toString()}`,
{
method: "GET",
headers: { "Content-Type": "application/json" },
},
);

Expand Down Expand Up @@ -357,9 +338,6 @@ export async function getEcosystemWalletUsage(args: {
`v2/wallet/connects?${searchParams.toString()}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
);

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

if (res?.status !== 200) {
Expand All @@ -415,9 +390,6 @@ export async function getUniversalBridgeWalletUsage(args: {
`v2/universal/wallets?${searchParams.toString()}`,
{
method: "GET",
headers: {
"Content-Type": "application/json",
},
},
);

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

Expand Down
Loading