mirror of
https://github.com/outline/outline.git
synced 2026-11-28 00:09:58 +03:00
fix: Run MCP create_document inside a transaction (#13335)
Co-authored-by: Claude Opus 5 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
fc7f33577f
commit
f65142989b
1 file changed
+21
-16
+21
-16
@@ -426,22 +426,27 @@ export function documentTools(server: McpServer, scopes: string[]) {
|
||||
authType: ctx.state.auth.type,
|
||||
ip: ctx.context.ip,
|
||||
})
|
||||
: await documentCreator(ctx, {
|
||||
title: input.title,
|
||||
text: input.text,
|
||||
icon: input.icon,
|
||||
color: input.color,
|
||||
parentDocumentId,
|
||||
publish: input.publish !== false,
|
||||
collectionId: collection?.id,
|
||||
template,
|
||||
fullWidth: input.fullWidth,
|
||||
sourceMetadata: input.sourceFileName
|
||||
? {
|
||||
fileName: input.sourceFileName,
|
||||
mimeType: "text/markdown",
|
||||
}
|
||||
: undefined,
|
||||
: await sequelize.transaction(async (transaction) => {
|
||||
ctx.state.transaction = transaction;
|
||||
ctx.context.transaction = transaction;
|
||||
|
||||
return documentCreator(ctx, {
|
||||
title: input.title,
|
||||
text: input.text,
|
||||
icon: input.icon,
|
||||
color: input.color,
|
||||
parentDocumentId,
|
||||
publish: input.publish !== false,
|
||||
collectionId: collection?.id,
|
||||
template,
|
||||
fullWidth: input.fullWidth,
|
||||
sourceMetadata: input.sourceFileName
|
||||
? {
|
||||
fileName: input.sourceFileName,
|
||||
mimeType: "text/markdown",
|
||||
}
|
||||
: undefined,
|
||||
});
|
||||
});
|
||||
|
||||
const breadcrumb = await getDocumentBreadcrumb(document, user);
|
||||
|
||||
Reference in new issue
Block a user