Files
evidencija-rezija/app/year-month/[id]/add/page.tsx

13 lines
477 B
TypeScript

import { addMonth } from '@/app/lib/actions/monthActions';
import { gotoHome } from '@/app/lib/actions/navigationActions';
import { parseYearMonth } from '@/app/lib/format';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const { year, month } = parseYearMonth(id);
await addMonth({ year, month });
await gotoHome(`/?year=${year}`);
return null; // if we don't return anything, the client-side will not re-validate cache
}