From 40402fc1bbda01f4209852eb6942515406a35d98 Mon Sep 17 00:00:00 2001 From: David Luecke Date: Sun, 16 Dec 2018 23:25:48 -0800 Subject: [PATCH] fix: Fix AdapterService multi option when set to true (#1134) --- packages/adapter-commons/lib/service.js | 2 +- packages/adapter-commons/test/service.test.js | 9 +++++++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/packages/adapter-commons/lib/service.js b/packages/adapter-commons/lib/service.js index 446163cf47..2e2780075a 100644 --- a/packages/adapter-commons/lib/service.js +++ b/packages/adapter-commons/lib/service.js @@ -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; diff --git a/packages/adapter-commons/test/service.test.js b/packages/adapter-commons/test/service.test.js index abf18d2df8..ff1b15f456 100644 --- a/packages/adapter-commons/test/service.test.js +++ b/packages/adapter-commons/test/service.test.js @@ -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', () => {