yearMonth split into year + month

This commit is contained in:
2024-01-09 15:43:01 +01:00
parent 90edcf14e1
commit 46b65711a8
12 changed files with 73 additions and 88 deletions

View File

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