Why after upgrade feathersjs I receive error: MethodNotAllowed
It can be corrected/enabled (e.g for patch) here
\\ @Src/services/[name]/[name].service.js
.
.
.
module.exports = function(app) {
Const options = {
Model: createModel(app),
Paginate: app.get('paginate'),
multi: ['patch']
};
.
.
.
},
In order to improve out-of-the-box security, creating, removing and modifying multiple entries has been disabled by default and has to be enabled using the multi
option (and secured explicitly). The migration instructions can be found at crow.docs.feathersjs.com/migrating.html#database-adapters:
const service = require('feathers-<database>');
// Allow multi create, patch and remove
service({
multi: true
});
// Only allow create with an array
service({
multi: [ 'create' ]
});
// Only allow multi patch and remove (with `id` set to `null`)
service({
multi: [ 'patch', 'remove' ]
});
Keep in mind that when enabling multiple remove
or patch
requests the allowed query must be restricted (e.g. based on the authenticated user id), otherwise it could be possible to delete or patch every record in the database.