Skip to content

Commit 40402fc

Browse files
authored
fix: Fix AdapterService multi option when set to true (#1134)
1 parent a6615d4 commit 40402fc

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

packages/adapter-commons/lib/service.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const callMethod = (self, name, ...args) => {
1111

1212
const checkMulti = (method, option) => {
1313
if (option === true) {
14-
return;
14+
return true;
1515
}
1616

1717
return Array.isArray(option) ? option.includes(method) : false;

packages/adapter-commons/test/service.test.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,15 @@ describe('@feathersjs/adapter-commons/service', () => {
9898
assert.strictEqual(error.message, 'Can not create multiple entries');
9999
});
100100
});
101+
102+
it('multi can be set to true', () => {
103+
const service = new MethodService();
104+
105+
service.options.multi = true;
106+
107+
return service.create([])
108+
.then(() => assert.ok(true));
109+
});
101110
});
102111

103112
it('filterQuery', () => {

0 commit comments

Comments
 (0)