mirror of
https://github.com/outline/outline.git
synced 2026-02-15 07:18:51 -06:00
If a document is created within a collection, publish it automatically. (#7243)
* If a document is created within a collection, publish it automatically. * automatically publish from app, not server * remove auto publish from server * New draft -> New doc
This commit is contained in:
@@ -41,17 +41,21 @@ function DocumentNew({ template }: Props) {
|
||||
if (id) {
|
||||
collection = await collections.fetch(id);
|
||||
}
|
||||
const document = await documents.create({
|
||||
collectionId: collection?.id,
|
||||
parentDocumentId,
|
||||
fullWidth:
|
||||
parentDocument?.fullWidth ||
|
||||
user.getPreference(UserPreference.FullWidthDocuments),
|
||||
templateId: query.get("templateId") ?? undefined,
|
||||
template,
|
||||
title: "",
|
||||
data: ProsemirrorHelper.getEmptyDocument(),
|
||||
});
|
||||
const document = await documents.create(
|
||||
{
|
||||
collectionId: collection?.id,
|
||||
parentDocumentId,
|
||||
fullWidth:
|
||||
parentDocument?.fullWidth ||
|
||||
user.getPreference(UserPreference.FullWidthDocuments),
|
||||
templateId: query.get("templateId") ?? undefined,
|
||||
template,
|
||||
title: "",
|
||||
data: ProsemirrorHelper.getEmptyDocument(),
|
||||
},
|
||||
{ publish: collection?.id || parentDocumentId ? true : undefined }
|
||||
);
|
||||
|
||||
history.replace(
|
||||
template || !user.separateEditMode
|
||||
? documentPath(document)
|
||||
|
||||
Reference in New Issue
Block a user