This commit is contained in:
James Grugett 2022-09-27 18:23:45 -04:00
parent 9826253230
commit d979d422c5
2 changed files with 3 additions and 4 deletions

View File

@ -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}`)
}
}

View File

@ -44,7 +44,7 @@ export default function DatePage(props: {
<Row className="items-center justify-between">
<Title className="!my-0 px-2 text-blue-500" text="Date docs" />
{!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'}