Skip to content

Commit 082682d

Browse files
authored
Merge pull request #20 from tainguyenbui/feature/HASI-000_allow_searching_only_published_data
specify headers
2 parents c32b0e3 + 89a2cb8 commit 082682d

3 files changed

Lines changed: 5 additions & 3 deletions

File tree

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "js-dataverse",
3-
"version": "1.0.32",
3+
"version": "1.0.33",
44
"description": "A Dataverse module for JavaScript/TypeScript",
55
"main": "./dist/index.js",
66
"types": "./dist/index.d.ts",

src/dataverseClient.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export class DataverseClient {
5252
}
5353

5454
public async searchOnlyPublished(options: SearchOptions): Promise<AxiosResponse> {
55-
return this.search(options, {})
55+
return this.search(options, {
56+
'X-Dataverse-key': ''
57+
})
5658
}
5759

5860
public async getFile(fileId: string): Promise<AxiosResponse> {

test/dataverseClient.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ describe('DataverseClient', () => {
359359
await client.searchOnlyPublished({ query: mockQuery, type, dataverseAlias: mockDataverseAlias })
360360

361361
assert.calledOnce(searchStub)
362-
assert.calledWithExactly(searchStub, expectedOptions, {})
362+
assert.calledWithExactly(searchStub, expectedOptions, {'X-Dataverse-key': ''})
363363
})
364364
})
365365

0 commit comments

Comments
 (0)