diff --git a/src/components/dashboard/PagesManager.tsx b/src/components/dashboard/PagesManager.tsx index ab3a1d55..e1c5a377 100644 --- a/src/components/dashboard/PagesManager.tsx +++ b/src/components/dashboard/PagesManager.tsx @@ -125,7 +125,10 @@ export const PagesManager: React.FC<{ ), onClick() { - pageDelete(page.id) + deletePage.mutate({ + site: subdomain, + id: page.id + }) }, }, ] diff --git a/src/pages/_site/[site]/[page].tsx b/src/pages/_site/[site]/[page].tsx index 03b43b86..835625d6 100644 --- a/src/pages/_site/[site]/[page].tsx +++ b/src/pages/_site/[site]/[page].tsx @@ -28,7 +28,7 @@ export const getServerSideProps: GetServerSideProps = serverSidePropsHandler( includeAuthors: true, }) - if (new Date(page.date_published) > new Date()) { + if (new Date(page!.date_published) > new Date()) { throw notFound() }