Hello I am currently learning more about strapi I am new and I am creating a new collection for user login, my problem is that I created a controller to encrypt my password but when I want to save it I get the following error
[2021-06-09T15:52:22.871Z] error TypeError: Cannot read property ‘create’ of undefined
at Object.createUser (C:\Users\Usuario\Documents\Universidad\portafolio\portafolio-cms\api\login-user\controllers\login-user.js:18:52)
my collection is called login-users and this is my controller
module.exports = {
async createUser(ctx) {
let entity;
const {password} = ctx.request.body;
const salt = await bcrypt.genSalt(10);
const pass = await bcrypt.hash(password,salt);
ctx.request.body.password = pass;
entity = await strapi.services.login_users.create(ctx.request.body);
return sanitizeEntity(entity, {model: strapi.modeles.login_users});
},
};