Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Fyrlex committed Oct 6, 2023
1 parent b229bb5 commit 4c5ae06
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 4 deletions.
2 changes: 1 addition & 1 deletion pages/admin/evenementen/create.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ const AdminCreateProducts: NextPage<{ user: { email: string, has2faEnabled: bool
type: 'success',
text: 'Event is succesvol aangemaakt!',
});
await router.push('/admin/evenements/');
await router.push('/admin/evenementen');
} else if (req.status === 401) {
setMessage({
type: 'error',
Expand Down
2 changes: 2 additions & 0 deletions pages/api/events/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,8 @@ export default withIronSessionApiRoute(async function eventsHandler(
return;
}

console.log(req.body);

const event = new Event(req.body);

try {
Expand Down
4 changes: 2 additions & 2 deletions pages/evenementen/[id].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ interface Props {
const EventDynamic: NextPage<Props> = ({ data }) => {
return (
<>
{useMetaData(data.name, data.description, `/evenements/${data._id}`)}
{useMetaData(data.name, data.description, `/evenementen/${data._id}`)}
<Layout>
<div className='container'>
<EventPage event={data} />
Expand All @@ -22,7 +22,7 @@ const EventDynamic: NextPage<Props> = ({ data }) => {
);
};

export const getServerSideProps = async ({ query }: NextPageContext & { query: { id: string } }): Promise<BaseProps<EventDocument>> => {
export const getServerSideProps = async ({ query }: NextPageContext & { query: { id: string; }; }): Promise<BaseProps<EventDocument>> => {
const req = await fetch(
`${process.env.NEXT_PUBLIC_DOMAIN}/api/events/${query.id}`,
);
Expand Down
2 changes: 1 addition & 1 deletion pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ const Index: NextPage<{ data: EventDocument[]; }> = ({ data }) => {
},
{
text: 'Purchase tickets!',
href: `/evenements/${event._id}`,
href: `/evenementen/${event._id}`,
tw: 'text-red-500',
},
]}
Expand Down

0 comments on commit 4c5ae06

Please sign in to comment.