diff --git a/web/pages/date-docs/create.tsx b/web/pages/date-docs/create.tsx index 8538bc73..a24905d9 100644 --- a/web/pages/date-docs/create.tsx +++ b/web/pages/date-docs/create.tsx @@ -8,7 +8,6 @@ import { Page } from 'web/components/page' import { Title } from 'web/components/title' import { useUser } from 'web/hooks/use-user' import { createPost } from 'web/lib/firebase/api' -import { postPath } from 'web/lib/firebase/posts' import { Row } from 'web/components/layout/row' import { Button } from 'web/components/button' import dayjs from 'dayjs' @@ -68,7 +67,7 @@ export default function CreateDateDocPage() { } async function saveDateDoc() { - if (!editor || !birthdayTime) return + if (!user || !editor || !birthdayTime) return const newPost: Omit< DateDoc, @@ -89,7 +88,7 @@ export default function CreateDateDocPage() { return e }) if (result.post) { - await Router.push(postPath(result.post.slug)) + await Router.push(`/date-docs/${user.username}`) } } diff --git a/web/pages/date-docs/index.tsx b/web/pages/date-docs/index.tsx index 6e009aa4..d2dd874c 100644 --- a/web/pages/date-docs/index.tsx +++ b/web/pages/date-docs/index.tsx @@ -44,7 +44,7 @@ export default function DatePage(props: { {!hasDoc && ( - <SiteLink href="/date/create" className="!no-underline"> + <SiteLink href="/date-docs/create" className="!no-underline"> <Button className="flex flex-row gap-1" color="blue"> <PlusCircleIcon className={'h-5 w-5 flex-shrink-0 text-white'}