Skip to content

Commit

Permalink
refactor: Preview
Browse files Browse the repository at this point in the history
update naming
  • Loading branch information
seaerchin committed Jun 25, 2024
1 parent b3acf31 commit 80e4b3d
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ export default function Preview({ schema }: PreviewProps) {
const [{ content: navbar }] = trpc.site.getNavbar.useSuspenseQuery({
id: 1,
})
const [data] = trpc.page.readPageAndBlob.useSuspenseQuery({
const [{ content: page }] = trpc.page.readPageAndBlob.useSuspenseQuery({
pageId: 1,
})

Expand Down Expand Up @@ -52,7 +52,7 @@ export default function Preview({ schema }: PreviewProps) {
lastModified: new Date().toISOString(),
}}
// TODO: remove this cast and add validation
content={data.content.content as IsomerComponent[]}
content={page.content}
/>
)
}
4 changes: 3 additions & 1 deletion apps/studio/src/server/modules/page/page.router.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { type IsomerPageSchema } from '@opengovsg/isomer-components'
import { protectedProcedure, router } from '~/server/trpc'
import {
createPageSchema,
Expand Down Expand Up @@ -30,7 +31,8 @@ export const pageRouter = router({
pageName,
navbar,
footer,
content,
// TODO: add validation on either read/write
content: content as IsomerPageSchema,
}
}),

Expand Down

0 comments on commit 80e4b3d

Please sign in to comment.