fix: Missing options in document menu for trashed documents
This commit is contained in:
@@ -2017,6 +2017,9 @@ describe("#documents.deleted", () => {
|
||||
const body = await res.json();
|
||||
expect(res.status).toEqual(200);
|
||||
expect(body.data.length).toEqual(1);
|
||||
expect(body.policies[0].abilities.delete).toEqual(false);
|
||||
expect(body.policies[0].abilities.restore).toEqual(true);
|
||||
expect(body.policies[0].abilities.permanentDelete).toEqual(true);
|
||||
});
|
||||
|
||||
it("should return deleted documents, including users drafts without collection", async () => {
|
||||
@@ -2049,6 +2052,9 @@ describe("#documents.deleted", () => {
|
||||
const body = await res.json();
|
||||
expect(res.status).toEqual(200);
|
||||
expect(body.data.length).toEqual(2);
|
||||
expect(body.policies[0].abilities.delete).toEqual(false);
|
||||
expect(body.policies[0].abilities.restore).toEqual(true);
|
||||
expect(body.policies[0].abilities.permanentDelete).toEqual(true);
|
||||
});
|
||||
|
||||
it("should not return documents in private collections not a member of", async () => {
|
||||
|
||||
@@ -256,6 +256,9 @@ router.post(
|
||||
const collectionIds = await user.collectionIds({
|
||||
paranoid: false,
|
||||
});
|
||||
const membershipScope: Readonly<ScopeOptions> = {
|
||||
method: ["withMembership", user.id],
|
||||
};
|
||||
const collectionScope: Readonly<ScopeOptions> = {
|
||||
method: ["withCollectionPermissions", user.id],
|
||||
};
|
||||
@@ -263,6 +266,7 @@ router.post(
|
||||
method: ["withViews", user.id],
|
||||
};
|
||||
const documents = await Document.scope([
|
||||
membershipScope,
|
||||
collectionScope,
|
||||
viewScope,
|
||||
"withDrafts",
|
||||
|
||||
Reference in New Issue
Block a user