src/infra/repositories/BaseRepository.js
/**
   * Generic function for finding rows using a field.
   *
   * @param {*} field
   * @param {*} value
   * @param {boolean} [active=true]
   * @returns
   * @memberof BaseRepository
   */
Generic function for finding rows using a field.
Generic function for finding rows using a field .
_findByField(field, value, active = true) {
    const where = { [field]: value };
    return this.model.findOne({ where }, { rejectOnEmpty: true });
  }
_findByField ( field , value , active = true ) { const where = { [ field ] : value } ; return this . model . findOne ( { where } , { rejectOnEmpty : true } ) ; }
Generic function for finding rows using a field.
Generic function for finding rows using a field .
// set the where clause // if (active) { //   where.active = { //     [Op.eq]: 1, //   }; // } // perform search