fix: Passing publish=true in documents.update with published document errors
This commit is contained in:
@@ -3032,6 +3032,7 @@ describe("#documents.update", () => {
|
||||
id: document.id,
|
||||
title: "Updated title",
|
||||
text: "Updated text",
|
||||
publish: true,
|
||||
},
|
||||
});
|
||||
const body = await res.json();
|
||||
|
||||
@@ -990,7 +990,10 @@ router.post(
|
||||
}
|
||||
|
||||
if (publish) {
|
||||
authorize(user, "publish", document);
|
||||
if (document.isDraft) {
|
||||
authorize(user, "publish", document);
|
||||
}
|
||||
|
||||
if (!document.collectionId) {
|
||||
assertPresent(
|
||||
collectionId,
|
||||
|
||||
Reference in New Issue
Block a user