Skip to content

The Postgres development platform. Supabase gives you a dedicated Postgres database to build your web, mobile, and AI applications.

Remove padding logic from org-daily-stats-query

Joshen Lim9affeb7bd02a
diff --git a/studio/components/interfaces/Organization/Usage/Bandwidth.tsx b/studio/components/interfaces/Organization/Usage/Bandwidth.tsx
index 221f8d42a20..e535844c113 100644
--- a/studio/components/interfaces/Organization/Usage/Bandwidth.tsx
+++ b/studio/components/interfaces/Organization/Usage/Bandwidth.tsx
@@ -37,6 +37,8 @@ const Bandwidth = ({
},
}
+ console.log(egressData)
+
return (
<UsageSection
orgSlug={orgSlug}
diff --git a/studio/components/interfaces/Organization/Usage/Usage.tsx b/studio/components/interfaces/Organization/Usage/Usage.tsx
index 66fc550cd22..01d9bf14487 100644
--- a/studio/components/interfaces/Organization/Usage/Usage.tsx
+++ b/studio/components/interfaces/Organization/Usage/Usage.tsx
@@ -115,7 +115,7 @@ const Usage = () => {
currentBillingCycleSelected={currentBillingCycleSelected}
/>
- <SizeAndCounts
+ {/* <SizeAndCounts
orgSlug={slug as string}
subscription={subscription}
startDate={startDate}
@@ -129,7 +129,7 @@ const Usage = () => {
startDate={startDate}
endDate={endDate}
currentBillingCycleSelected={currentBillingCycleSelected}
- />
+ /> */}
</>
)
}
diff --git a/studio/data/analytics/org-daily-stats-query.ts b/studio/data/analytics/org-daily-stats-query.ts
index 6b55f63cb31..715d16a010d 100644
--- a/studio/data/analytics/org-daily-stats-query.ts
+++ b/studio/data/analytics/org-daily-stats-query.ts
@@ -106,37 +106,19 @@ export const useOrgDailyStatsQuery = <TData = OrgDailyStatsData>(
typeof endDate !== 'undefined',
select(data) {
- const noDataYet = data.data[0]?.id === undefined
-
- // [Joshen] Ideally handled by API, like infra-monitoring
- if (noDataYet) {
- const days = dayjs(endDate).diff(dayjs(startDate), 'days')
- const tempArray = new Array(days).fill(0)
- const mockData = tempArray.map((x, idx) => {
+ return {
+ ...data,
+ data: data.data.map((x) => {
return {
- loopId: idx,
- period_start: dayjs(startDate).add(idx, 'day').format('DD MMM YYYY'),
- periodStartFormatted: dayjs(startDate).add(idx, 'day').format(dateFormat),
- [metric as string]: 0,
+ ...x,
+ [metric as string]:
+ modifier !== undefined
+ ? modifier(Number(x[metric as string]))
+ : Number(x[metric as string]),
+ periodStartFormatted: dayjs(x.period_start).format(dateFormat),
}
- })
- return { ...data, data: mockData, hasNoData: true } as TData
- } else {
- return {
- ...data,
- hasNoData: false,
- data: data.data.map((x) => {
- return {
- ...x,
- [metric as string]:
- modifier !== undefined
- ? modifier(Number(x[metric as string]))
- : Number(x[metric as string]),
- periodStartFormatted: dayjs(x.period_start).format(dateFormat),
- }
- }),
- } as TData
- }
+ }),
+ } as TData
},
staleTime: 1000 * 60 * 60, // default good for an hour for now
...options,