Skip to content

Commit

Permalink
fix: Fix AdapterService multi option when set to true (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
daffl authored Dec 17, 2018
1 parent a6615d4 commit 40402fc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion packages/adapter-commons/lib/service.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const callMethod = (self, name, ...args) => {

const checkMulti = (method, option) => {
if (option === true) {
return;
return true;
}

return Array.isArray(option) ? option.includes(method) : false;
Expand Down
9 changes: 9 additions & 0 deletions packages/adapter-commons/test/service.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,15 @@ describe('@feathersjs/adapter-commons/service', () => {
assert.strictEqual(error.message, 'Can not create multiple entries');
});
});

it('multi can be set to true', () => {
const service = new MethodService();

service.options.multi = true;

return service.create([])
.then(() => assert.ok(true));
});
});

it('filterQuery', () => {
Expand Down

0 comments on commit 40402fc

Please # to comment.