text: 'use strict';
  
  /**
   * Read the documentation (https://strapi.io/documentation/developer-docs/latest/concepts/models.html#lifecycle-hooks)
   * to customize this model
   */
  const bcrypt = require('bcryptjs');
  module.exports = {
      lifecycles: {
          /**
           * Triggered before entry creation.
          */
           async beforeCreate(data) {
                const salt = await bcrypt.genSalt(10);
                const pword = await bcrypt.hash(data.password, salt);
                data.password = pword
           },
          /**
           * Triggered before entry update.
          */
       //     async beforeUpdate(params,data) {
       //        const salt = await bcrypt.genSalt(10);
       //          const pword = await bcrypt.hash(data.password, salt);
       //          data.password = pword
       //     },
         },
  };
  