Skip to content

Commit 0206203

Browse files
authored
Fixed return for custom params method. (#44)
1 parent 38deb07 commit 0206203

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

src/__tests__/CustomParam.test.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ test('Custom parameters', () => {
77
api.addCustomParam({ foo: { bar: 'baz' } });
88
api.addCustomParam({ bar: ['a', 'b', 'c'] });
99
expect(api.getQueryString({ encode: false })).toBe('foo[bar]=baz&bar[0]=a&bar[1]=b&bar[2]=c');
10+
api.clear();
11+
expect(api.getQueryString()).toBe('');
12+
expect(api.addCustomParam({ foo: 'bar' })).toBeInstanceOf(DrupalJsonApiParams)
1013
});
1114

1215
test("Nova's Ark with custom params", () => {

src/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,6 +111,7 @@ export class DrupalJsonApiParams implements DrupalJsonApiParamsInterface {
111111
...this.data,
112112
...input,
113113
};
114+
return this;
114115
}
115116

116117
/**

0 commit comments

Comments
 (0)