We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d4b7e1b commit 543faf5Copy full SHA for 543faf5
server/services/contributions/hooks/getAssociatedCanDos.js
@@ -9,6 +9,11 @@ module.exports = function (options = {}) { // eslint-disable-line no-unused-vars
9
return resolve(hook);
10
}
11
12
+ // Stop, if it was a find method and $limit was not set
13
+ if (hook.method === 'find' && (!hook.params.query || hook.params.query.$limit !== 1)) {
14
+ return resolve(hook);
15
+ }
16
+
17
// Stop, if we have an empty array or more then one item
18
let isArray = hook.result.data && Array.isArray(hook.result.data)
19
if (isArray && (!hook.result.data.length || hook.result.data.length > 1)) {
0 commit comments