Collection Permissions (#829)
see https://github.com/outline/outline/issues/668
This commit is contained in:
@ -1,6 +1,5 @@
|
||||
// @flow
|
||||
import { Collection } from '../models';
|
||||
import presentDocument from './document';
|
||||
import naturalSort from '../../shared/utils/naturalSort';
|
||||
|
||||
type Document = {
|
||||
@ -29,9 +28,9 @@ async function present(ctx: Object, collection: Collection) {
|
||||
description: collection.description,
|
||||
color: collection.color || '#4E5C6E',
|
||||
type: collection.type,
|
||||
private: collection.private,
|
||||
createdAt: collection.createdAt,
|
||||
updatedAt: collection.updatedAt,
|
||||
recentDocuments: undefined,
|
||||
documents: undefined,
|
||||
};
|
||||
|
||||
@ -40,14 +39,6 @@ async function present(ctx: Object, collection: Collection) {
|
||||
data.documents = sortDocuments(collection.documentStructure);
|
||||
}
|
||||
|
||||
if (collection.documents) {
|
||||
data.recentDocuments = await Promise.all(
|
||||
collection.documents.map(
|
||||
async document => await presentDocument(ctx, document)
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
return data;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user