fix: Prevent moving documents into drafts

This commit is contained in:
Tom Moor
2023-01-12 11:15:54 -05:00
parent 3be170ddb8
commit 17a8dbb3f0
3 changed files with 27 additions and 1 deletions

View File

@@ -904,6 +904,10 @@ router.post(
userId: user.id,
});
authorize(user, "update", parent);
if (!parent.publishedAt) {
throw InvalidRequestError("Cannot move document inside a draft");
}
}
const {