Skip to content

Commit

Permalink
fix: pass in params expected of page.readPageAndBlob query
Browse files Browse the repository at this point in the history
  • Loading branch information
karrui committed Jul 17, 2024
1 parent b174e14 commit 2487dcd
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion apps/studio/src/pages/sites/[siteId]/pages/[pageId]/index.tsx
Original file line number Diff line number Diff line change
@@ -1,18 +1,27 @@
import { useEffect } from "react"
import { Grid, GridItem } from "@chakra-ui/react"
import { z } from "zod"

import { useEditorDrawerContext } from "~/contexts/EditorDrawerContext"
import EditPageDrawer from "~/features/editing-experience/components/EditPageDrawer"
import Preview from "~/features/editing-experience/components/Preview"
import { useQueryParse } from "~/hooks/useQueryParse"
import { PageEditingLayout } from "~/templates/layouts/PageEditingLayout"
import { trpc } from "~/utils/trpc"

const editPageSchema = z.object({
pageId: z.coerce.number(),
siteId: z.coerce.number(),
})

function EditPage(): JSX.Element {
const { pageId, siteId } = useQueryParse(editPageSchema)
const { setDrawerState, pageState, setPageState, setEditorState } =
useEditorDrawerContext()

const [{ content: page }] = trpc.page.readPageAndBlob.useSuspenseQuery({
pageId: 1,
pageId,
siteId,
})

useEffect(() => {
Expand Down

0 comments on commit 2487dcd

Please sign in to comment.