When I try to set this code,
MyModel.sharedClass.find('destroyAll', true).shared = true;
it always throws this error:
TypeError: Cannot set property 'shared' of null
destroyAll is not a shared method. You can use MyMode.remoteMethod() as follows:
MyModel.remoteMethod('destroyAll', {
isStatic: true,
description: 'Delete all matching records',
accessType: 'WRITE',
accepts: {arg: 'where', type: 'object', description: 'filter.where object'},
http: {verb: 'del', path: '/'}
});
Most helpful comment
destroyAllis not a shared method. You can use MyMode.remoteMethod() as follows: