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 } }) {

    await addMonth(parseYearMonth(id));

    revalidatePath('/');
    redirect(`/`);
}