diff options
Diffstat (limited to 'src/services/validate.js')
-rw-r--r-- | src/services/validate.js | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/services/validate.js b/src/services/validate.js index c80542f9..e4245c4b 100644 --- a/src/services/validate.js +++ b/src/services/validate.js @@ -20,10 +20,11 @@ * */ -import Contact from '../models/contact' +import Contact from 'Models/contact' import checks from './checks/' export default function(contact) { + let result = false if (contact instanceof Contact) { // Going through every checks @@ -37,6 +38,7 @@ export default function(contact) { console.warn('The following contact needed a correction that failed:', check.name, contact) } else { // SUCCESS 💪 + result = true console.info('The following contact has been repaired:', check.name, contact) } } @@ -44,7 +46,7 @@ export default function(contact) { console.error('Error during the check:', check.name, contact, error) } }) - + return result } else { throw new Error('Invalid contact provided') } |