yearMonth split into year + month
This commit is contained in:
@@ -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(`/`);
|
||||
|
||||
Reference in New Issue
Block a user