fix: Types on overridden findByPk methods (#5908)

This commit is contained in:
Tom Moor
2023-10-01 15:02:56 -04:00
committed by GitHub
parent e2a6d828a9
commit 41a6f77998
6 changed files with 59 additions and 16 deletions

View File

@@ -928,8 +928,8 @@ router.post(
// reload to get all of the data needed to present (user, collection etc)
const reloaded = await Document.findByPk(document.id, {
userId: user.id,
rejectOnEmpty: true,
});
invariant(reloaded, "document not found");
ctx.body = {
data: await presentDocument(reloaded),