Skip to content

Commit b86470d

Browse files
authored
Merge pull request #215 from digitalsadhu/nfrasser-master
feat(config): Use disableRemoteMethodByName instead of disableRemoteMethod
2 parents b2bfd40 + 230156d commit b86470d

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

lib/removeRemoteMethods.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,16 @@ module.exports = function (app, options) {
33

44
// use loopbacks standard API to disable all methods that JSON API
55
// does not support.
6-
var isStatic = true
76

87
if (options.hideIrrelevantMethods !== false) {
98
options.debug('Disable methods not supported by `jsonapi`. (Set `options.hideIrrelevantMethods = false` to re-enable)')
109
Object.keys(models).forEach(function (model) {
1110
['upsert', 'exists', 'findOne', 'count', 'createChangeStream', 'updateAll'].forEach(function (method) {
12-
models[model].disableRemoteMethod(method, isStatic)
11+
if (models[model].disableRemoteMethodByName) {
12+
models[model].disableRemoteMethodByName(method)
13+
} else if (models[model].disableRemoteMethod) {
14+
models[model].disableRemoteMethod(method, true)
15+
}
1316
})
1417
})
1518
options.debug('`upsert`, `exists`, `findOne`, `count`, `createChangeStream` and `updateAll` disabled for all models')

0 commit comments

Comments
 (0)