mirror of
https://github.com/strapi/strapi.git
synced 2025-11-08 14:19:40 +00:00
Correct description to match example
The description doesn't match the example. The example is correct
This commit is contained in:
parent
88008ea900
commit
e3f9772525
@ -621,7 +621,7 @@ Callbacks on `destroy`:
|
|||||||
|
|
||||||
#### Mongoose
|
#### Mongoose
|
||||||
|
|
||||||
Each of these functions receives a parameter called `next`, which is the callback you should call after your logic is executed. The entry is accessible through `this`.
|
The entry is available through the `model` parameter
|
||||||
|
|
||||||
**Path —** `./api/user/models/User.js`.
|
**Path —** `./api/user/models/User.js`.
|
||||||
```js
|
```js
|
||||||
@ -631,7 +631,7 @@ module.exports = {
|
|||||||
*/
|
*/
|
||||||
beforeCreate: async (model) => {
|
beforeCreate: async (model) => {
|
||||||
// Hash password.
|
// Hash password.
|
||||||
const passwordHashed = await strapi.api.user.services.user.hashPassword(this.password);
|
const passwordHashed = await strapi.api.user.services.user.hashPassword(model.password);
|
||||||
|
|
||||||
// Set the password.
|
// Set the password.
|
||||||
model.password = passwordHashed;
|
model.password = passwordHashed;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user