src/services/ammoinventory.service.js
/**
   * Checks if an ammo inventory item exists.
   *
   * @param {*} caliber
   * @param {*} brand
   * @param {*} name
   * @param {*} userId
   */
Checks if an ammo inventory item exists.
Checks if an ammo inventory item exists .
static async exists(caliber, brand, name, userId) {
    try {
      const count = await AmmoInventory.count({
        where: {
          caliber: {
            [Op.eq]: caliber,
          },
          brand: {
            [Op.eq]: brand,
          },
          name: {
            [Op.eq]: name,
          },
          user_id: {
            [Op.eq]: userId,
          },
        },
      });
      return count > 0;
    } catch (error) {
      throw error;
    }
  }
static async exists ( caliber , brand , name , userId ) { try { const count = await AmmoInventory . count ( { where : { caliber : { [ Op . eq ] : caliber , } , brand : { [ Op . eq ] : brand , } , name : { [ Op . eq ] : name , } , user_id : { [ Op . eq ] : userId , } , } , } ) ; return count > 0 ; } catch ( error ) { throw error ; } }
Checks if an ammo inventory item exists.
Checks if an ammo inventory item exists .