src/repositories/LikeRepository.js
/**
   * Check if like exists by user id and accommodatio id.
   * @param {object} user_id.
   * @param {object} accommodation_id.
   * @returns {object} Like object.
   */
Check if like exists by user id and accommodatio id.
Check if like exists by user id and accommodatio id .
static async checkLikes({ user_id, accommodation_id }) {
    try {
      const result = await Like.findAll({
        where:
          {
            user_id, accommodation_id
          }
      });
      return result;
    } catch (error) {
      throw (error);
    }
  }
static async checkLikes ( { user_id , accommodation_id } ) { try { const result = await Like . findAll ( { where : { user_id , accommodation_id } } ) ; return result ; } catch ( error ) { throw ( error ) ; } }
Check if like exists by user id and accommodatio id.
Check if like exists by user id and accommodatio id .