Files
kt-financial-system/apps/backend/api/finance/categories.get.ts
你的用户名 b68511b2e2
Some checks failed
Deploy to Production / Build and Test (push) Successful in 10m51s
Deploy to Production / Deploy to Server (push) Failing after 6m41s
feat: migrate backend storage to postgres
2025-11-06 22:01:50 +08:00

13 lines
399 B
TypeScript

import { getQuery } from 'h3';
import { fetchCategories } from '~/utils/finance-repository';
import { useResponseSuccess } from '~/utils/response';
export default defineEventHandler(async (event) => {
const query = getQuery(event);
const type = query.type as 'expense' | 'income' | undefined;
const categories = await fetchCategories({ type });
return useResponseSuccess(categories);
});