From 33fea77a86836890aef19aed7be3a0e4e49bb85e Mon Sep 17 00:00:00 2001 From: Tom Moor Date: Sun, 26 Nov 2017 18:18:04 -0800 Subject: [PATCH] PR feedback, remove collectionId --- app/models/Document.js | 1 - app/stores/DocumentsStore.js | 2 +- server/api/documents.test.js | 2 +- server/presenters/document.js | 1 - 4 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/models/Document.js b/app/models/Document.js index c67b1c58..00397a5d 100644 --- a/app/models/Document.js +++ b/app/models/Document.js @@ -20,7 +20,6 @@ class Document extends BaseModel { collaborators: Array; collection: $Shape; - collectionId: string; firstViewedAt: ?string; lastViewedAt: ?string; modifiedSinceViewed: ?boolean; diff --git a/app/stores/DocumentsStore.js b/app/stores/DocumentsStore.js index 4c05276b..f03d025e 100644 --- a/app/stores/DocumentsStore.js +++ b/app/stores/DocumentsStore.js @@ -56,7 +56,7 @@ class DocumentsStore extends BaseStore { return _.orderBy( _.filter( this.data.values(), - document => document.collectionId === collectionId + document => document.collection.id === collectionId ), 'updatedAt', 'desc' diff --git a/server/api/documents.test.js b/server/api/documents.test.js index 82380eed..a7dbb96d 100644 --- a/server/api/documents.test.js +++ b/server/api/documents.test.js @@ -37,7 +37,7 @@ describe('#documents.list', async () => { it('should allow filtering by collection', async () => { const { user, document } = await seed(); const res = await server.post('/api/documents.list', { - body: { token: user.getJwtToken(), collectionId: document.atlasId }, + body: { token: user.getJwtToken(), collection: document.atlasId }, }); const body = await res.json(); diff --git a/server/presenters/document.js b/server/presenters/document.js index 29ddff81..575d18f3 100644 --- a/server/presenters/document.js +++ b/server/presenters/document.js @@ -36,7 +36,6 @@ async function present(ctx: Object, document: Document, options: ?Options) { team: document.teamId, collaborators: [], starred: !!(document.starred && document.starred.length), - collectionId: document.atlasId, collaboratorCount: undefined, collection: undefined, views: undefined,