Skip to content

Commit

Permalink
fix(frontend): check onboarding status after filters api call
Browse files Browse the repository at this point in the history
fixes #1638
  • Loading branch information
anupcowkur committed Dec 18, 2024
1 parent 92f1f03 commit f9c3ad2
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions frontend/dashboard/app/api/api_calls.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1035,10 +1035,6 @@ export const fetchTraceFromServer = async (appId: string, traceId: string, route
}

export const fetchFiltersFromServer = async (selectedApp: typeof emptyApp, filtersApiType: FiltersApiType, router: AppRouterInstance) => {
if (!selectedApp.onboarded) {
return { status: FiltersApiStatus.NotOnboarded, data: null }
}

const origin = process.env.NEXT_PUBLIC_API_BASE_URL

let url = `${origin}/apps/${selectedApp.id}/filters`
Expand All @@ -1063,7 +1059,11 @@ export const fetchFiltersFromServer = async (selectedApp: typeof emptyApp, filte
const data = await res.json()

if (data.versions === null) {
return { status: FiltersApiStatus.NoData, data: null }
if (!selectedApp.onboarded) {
return { status: FiltersApiStatus.NotOnboarded, data: null }
} else {
return { status: FiltersApiStatus.NoData, data: null }
}
}

return { status: FiltersApiStatus.Success, data: data }
Expand Down

0 comments on commit f9c3ad2

Please sign in to comment.