year & month replaced by yearMonth object

This commit is contained in:
2024-01-09 16:20:49 +01:00
parent 46b65711a8
commit d627ad757d
12 changed files with 82 additions and 64 deletions

View File

@@ -1,12 +1,11 @@
import { addMonth } from '@/app/lib/actions/monthActions';
import { parseYearMonth } from '@/app/lib/format';
import { revalidatePath } from 'next/cache';
import { redirect } from 'next/navigation';
export default async function Page({ params:{ id } }: { params: { id:string } }) {
const [year, month] = id.split("-");
await addMonth(year, month);
await addMonth(parseYearMonth(id));
revalidatePath('/');
redirect(`/`);