Skip to content

Commit

Permalink
Fix pullMetadata really (#977)
Browse files Browse the repository at this point in the history
  • Loading branch information
glasserc authored and leplatrem committed May 16, 2019
1 parent 5dfc78b commit a21cda4
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions src/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -1422,12 +1422,13 @@ export default class Collection {
}

async pullMetadata(client, options = {}) {
const { expectedTimestamp } = options;
const { expectedTimestamp, headers } = options;
const query = expectedTimestamp
? { query: { _expected: expectedTimestamp } }
: undefined;
const metadata = await client.getData(query, {
headers: options.headers,
const metadata = await client.getData({
...query,
headers,
});
return this.db.saveMetadata(metadata);
}
Expand Down
2 changes: 1 addition & 1 deletion test/collection_test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3274,7 +3274,7 @@ describe("Collection", () => {
getData: sandbox.stub(),
};
return articles.pullMetadata(client, { headers }).then(_ => {
sinon.assert.calledWithExactly(client.getData, undefined, {
sinon.assert.calledWithExactly(client.getData, {
headers,
});
});
Expand Down

0 comments on commit a21cda4

Please sign in to comment.