mirror of
https://github.com/felipegcoutinho/openmonetis.git
synced 2026-05-10 19:21:46 +00:00
refactor: atualiza transacoes dashboard e relatorios
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { redirect } from "next/navigation";
|
||||
import type { Categoria } from "@/db/schema";
|
||||
import type { Category } from "@/db/schema";
|
||||
import { fetchCategoryChartData } from "@/features/reports/category-chart-queries";
|
||||
import { fetchCategoryReport } from "@/features/reports/category-report-queries";
|
||||
import { fetchUserCategories } from "@/features/reports/category-trends-queries";
|
||||
@@ -38,7 +38,7 @@ export default async function Page({ searchParams }: PageProps) {
|
||||
// Extract query params
|
||||
const inicioParam = getSingleParam(resolvedSearchParams, "inicio");
|
||||
const fimParam = getSingleParam(resolvedSearchParams, "fim");
|
||||
const categoriasParam = getSingleParam(resolvedSearchParams, "categorias");
|
||||
const categoriasParam = getSingleParam(resolvedSearchParams, "categories");
|
||||
|
||||
// Calculate default period (last 6 months)
|
||||
const currentPeriod = getCurrentPeriod();
|
||||
@@ -63,11 +63,11 @@ export default async function Page({ searchParams }: PageProps) {
|
||||
}
|
||||
|
||||
// Fetch all categories for the user
|
||||
const categoriaRows = await fetchUserCategories(userId);
|
||||
const categoryRows = await fetchUserCategories(userId);
|
||||
|
||||
// Map to CategoryOption format
|
||||
const categoryOptions: CategoryOption[] = categoriaRows.map(
|
||||
(cat: Categoria): CategoryOption => ({
|
||||
const categoryOptions: CategoryOption[] = categoryRows.map(
|
||||
(cat: Category): CategoryOption => ({
|
||||
id: cat.id,
|
||||
name: cat.name,
|
||||
icon: cat.icon,
|
||||
|
||||
Reference in New Issue
Block a user