fix: Users not mentionable when not in seamless editing mode

This commit is contained in:
Tom Moor
2023-03-28 22:32:35 -04:00
parent 7ba6a9379b
commit a2f1f059c7
3 changed files with 17 additions and 9 deletions

View File

@@ -445,18 +445,18 @@ router.post(
const { id, query } = ctx.input.body;
const actor = ctx.state.auth.user;
const { offset, limit } = ctx.state.pagination;
const document = await Document.findByPk(id);
const document = await Document.findByPk(id, {
userId: actor.id,
});
authorize(actor, "read", document);
let users: User[] = [];
let total = 0;
if (document.collectionId) {
const [collection, memberIds] = await Promise.all([
Collection.findByPk(document.collectionId),
Collection.membershipUserIds(document.collectionId),
]);
authorize(actor, "update", collection);
const memberIds = await Collection.membershipUserIds(
document.collectionId
);
let where: WhereOptions<User> = {
id: {