Inherit 'full width' setting creating new child document

towards #5562
This commit is contained in:
Tom Moor
2023-07-15 23:21:59 -04:00
parent abb38ea447
commit 4b14fa5dd7
4 changed files with 16 additions and 3 deletions

View File

@@ -12,9 +12,10 @@ type Props = {
collectionId?: string | null;
parentDocumentId?: string | null;
importId?: string;
templateDocument?: Document | null;
publishedAt?: Date;
template?: boolean;
templateDocument?: Document | null;
fullWidth?: boolean;
createdAt?: Date;
updatedAt?: Date;
user: User;
@@ -33,12 +34,13 @@ export default async function documentCreator({
publish,
collectionId,
parentDocumentId,
template,
templateDocument,
fullWidth,
importId,
createdAt,
// allows override for import
updatedAt,
template,
user,
editorVersion,
publishedAt,
@@ -76,6 +78,7 @@ export default async function documentCreator({
createdById: user.id,
template,
templateId,
fullWidth,
publishedAt,
importId,
title: templateDocument

View File

@@ -1267,6 +1267,7 @@ router.post(
publish,
collectionId,
parentDocumentId,
fullWidth,
templateId,
template,
} = ctx.input.body;
@@ -1320,6 +1321,7 @@ router.post(
parentDocumentId,
templateDocument,
template,
fullWidth,
user,
editorVersion,
ip: ctx.request.ip,

View File

@@ -289,6 +289,9 @@ export const DocumentsCreateSchema = BaseSchema.extend({
/** Create doc with this template */
templateId: z.string().uuid().optional(),
/** Boolean to denote if the doc should occupy full width */
fullWidth: z.boolean().optional(),
/** Whether to create a template doc */
template: z.boolean().optional(),
}),