fix: Pass user context to document loader in urls unfurl
This commit is contained in:
@@ -30,7 +30,7 @@ router.post(
|
|||||||
const [user, document] = await Promise.all([
|
const [user, document] = await Promise.all([
|
||||||
User.findByPk(userId),
|
User.findByPk(userId),
|
||||||
Document.findByPk(documentId!, {
|
Document.findByPk(documentId!, {
|
||||||
userId,
|
userId: actor.id,
|
||||||
}),
|
}),
|
||||||
]);
|
]);
|
||||||
if (!user) {
|
if (!user) {
|
||||||
@@ -53,7 +53,9 @@ router.post(
|
|||||||
}
|
}
|
||||||
|
|
||||||
const document = previewDocumentId
|
const document = previewDocumentId
|
||||||
? await Document.findByPk(previewDocumentId)
|
? await Document.findByPk(previewDocumentId, {
|
||||||
|
userId: actor.id,
|
||||||
|
})
|
||||||
: undefined;
|
: undefined;
|
||||||
if (!document) {
|
if (!document) {
|
||||||
throw NotFoundError("Document does not exist");
|
throw NotFoundError("Document does not exist");
|
||||||
|
|||||||
Reference in New Issue
Block a user