System Information
- 4.x:
- MySQL:
Hi,
I am trying to create a user (table: up_users) and set the role, but the role is not set. What is the correct syntax to set the role?
I have tried the following:
const entry = await strapi.entityService.create('plugin::users-permissions.user', {
data: { username: name, email: email, provider: 'local', password: pwd_hash, confirmationToken: null, confirmed: false, blocked: false, },
populate: {
role: {
where: {
type: 'user'
}
},
}
})
const entry = await strapi.entityService.create('plugin::users-permissions.user', {
data: { username: name, email: email, provider: 'local', password: pwd_hash, confirmationToken: null, confirmed: false, blocked: false, },
populate: {
role: {
type: 'user'
},
}
})
const entry = await strapi.db.query('plugin::users-permissions.user').create({
data: { username: name, email: email, provider: 'local', password: pwd_hash, confirmationToken: null, confirmed: false, blocked: false, },
populate: {
role: {
where: {
type: 'user'
}
},
},
})