[WEB-1480] fix: preserve page access when making a copy (#4568)

This commit is contained in:
Aaryan Khandelwal 2024-05-29 18:19:50 +05:30 committed by GitHub
parent 6636a64817
commit 8a30c2c484
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -38,7 +38,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
// store hooks // store hooks
const { createPage, getPageById } = useProjectPages(projectId?.toString() ?? ""); const { createPage, getPageById } = useProjectPages(projectId?.toString() ?? "");
const page = usePage(pageId?.toString() ?? ""); const page = usePage(pageId?.toString() ?? "");
const { description_html, id, name } = page; const { access, description_html, id, name } = page;
// editor markings hook // editor markings hook
const { markings, updateMarkings } = useEditorMarkings(); const { markings, updateMarkings } = useEditorMarkings();
// fetch page details // fetch page details
@ -81,6 +81,7 @@ const PageDetailsPage: NextPageWithLayout = observer(() => {
const formData: Partial<TPage> = { const formData: Partial<TPage> = {
name: "Copy of " + name, name: "Copy of " + name,
description_html: description_html ?? "<p></p>", description_html: description_html ?? "<p></p>",
access,
}; };
await handleCreatePage(formData) await handleCreatePage(formData)