Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

fix: Fix AdapterService multi option when set to true #1134

Merged
merged 1 commit into from
Dec 17, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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