add new site accepts duration

This commit is contained in:
realaravinth
2021-05-04 11:07:18 +05:30
parent e83a362e75
commit 1e1ec187dc
6 changed files with 38 additions and 7 deletions

View File

@@ -34,11 +34,11 @@ const getLevelFields = (id: number) => {
const visitor_threshold = parseInt(visitorElement.value);
const difficulty_factor = parseInt(difficultyElement.value);
if (!isNumber(visitor_threshold) || Number.isNaN(visitor_threshold)) {
if (Number.isNaN(visitor_threshold)) {
throw new Error('visitor can contain nubers only');
}
if (!isNumber(difficulty_factor) || Number.isNaN(difficulty_factor)) {
if (Number.isNaN(difficulty_factor)) {
throw new Error('difficulty can contain nubers only');
}

View File

@@ -98,6 +98,7 @@ export const LEVELS = (function() {
}
return true;
} catch (e) {
console.log(e);
return false;
}
},