Utils/utility_functions.js
/**
 * Check if users can create a private alarms
 * @param {String} user_id - the id of the user
 */
Check if users can create a private alarms
@param {String} user_id - the id of the user
Check if users can create a private alarms @param { String } user_id - the id of the user
async function can_create_private_alarm(user_id) {
    let alarmsUser = await alarm_db.get_all_privAlarms_from_user(user_id);
    if (await (isPremiumUser(user_id))) {
        return alarmsUser.length < auth.max_alarms_VIP;
    }
    return alarmsUser.length < auth.max_alarms_user;
}
async function can_create_private_alarm ( user_id ) { let alarmsUser = await alarm_db . get_all_privAlarms_from_user ( user_id ) ; if ( await ( isPremiumUser ( user_id ) ) ) { return alarmsUser . length < auth . max_alarms_VIP ; } return alarmsUser . length < auth . max_alarms_user ; }
Check if users can create a private alarms
 @param {String} user_id - the id of the user
Check if users can create a private alarms @param { String } user_id - the id of the user