Skip to content

Commit

Permalink
Use v1 functions
Browse files Browse the repository at this point in the history
  • Loading branch information
pontusab committed May 13, 2024
1 parent c7e4f93 commit aef6945
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 6 deletions.
Expand Up @@ -26,7 +26,7 @@ export function TransactionListItem({ transaction, disabled }: Props) {
className={cn(
"text-sm",
disabled && "skeleton-box",
row.original?.category?.slug === "income" && "text-[#00C969]"
transaction?.category?.slug === "income" && "text-[#00C969]"
)}
>
{transaction.name}
Expand All @@ -37,7 +37,7 @@ export function TransactionListItem({ transaction, disabled }: Props) {
className={cn(
"text-sm",
disabled && "skeleton-box",
row.original?.category?.slug === "income" && "text-[#00C969]"
transaction?.category?.slug === "income" && "text-[#00C969]"
)}
>
<FormatAmount
Expand Down
Expand Up @@ -58,6 +58,8 @@ export function BottomBar({ count, show, totalAmount }: Props) {
amount: first?.amount,
currency: first?.currency,
locale,
maximumFractionDigits: 0,
minimumFractionDigits: 0,
})}
</span>
</TooltipTrigger>
Expand Down
8 changes: 4 additions & 4 deletions packages/supabase/src/queries/index.ts
Expand Up @@ -147,7 +147,7 @@ export async function getSpendingQuery(
supabase: Client,
params: GetSpendingParams
) {
return supabase.rpc("get_spending_v2", {
return supabase.rpc("get_spending", {
team_id: params.teamId,
date_from: params.from,
date_to: params.to,
Expand Down Expand Up @@ -372,7 +372,7 @@ export async function getBurnRateQuery(
const fromDate = new UTCDate(from);
const toDate = new UTCDate(to);

return supabase.rpc("get_burn_rate_v2", {
return supabase.rpc("get_burn_rate", {
team_id: teamId,
date_from: startOfMonth(fromDate).toDateString(),
date_to: endOfMonth(toDate).toDateString(),
Expand Down Expand Up @@ -416,7 +416,7 @@ export async function getCurrentBurnRateQuery(
) {
const { teamId, currency } = params;

return supabase.rpc("get_current_burn_rate_v2", {
return supabase.rpc("get_current_burn_rate", {
team_id: teamId,
currency,
});
Expand All @@ -436,7 +436,7 @@ export async function getMetricsQuery(
) {
const { teamId, from, to, type = "profit", currency } = params;

const rpc = type === "profit" ? "get_profit_v2" : "get_revenue_v2";
const rpc = type === "profit" ? "get_profit" : "get_revenue";

const fromDate = new UTCDate(from);
const toDate = new UTCDate(to);
Expand Down

0 comments on commit aef6945

Please sign in to comment.