feat(expenses): add monthly totals and pagination support for expenses
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
import type { Context } from "hono";
|
||||
import { getMonthlyPayedTotal } from "../expenses.service";
|
||||
|
||||
export async function getMonthlyPayedTotalHandler(c: Context) {
|
||||
const year = parseInt(c.req.query("year") ?? String(new Date().getUTCFullYear()), 10);
|
||||
const month = parseInt(c.req.query("month") ?? String(new Date().getUTCMonth() + 1), 10);
|
||||
const result = await getMonthlyPayedTotal(year, month);
|
||||
return c.json(result);
|
||||
}
|
||||
Reference in New Issue
Block a user