mirror of
https://github.com/janishutz/libreevent.git
synced 2026-09-22 13:15:25 +02:00
signup partially working
This commit is contained in:
1 parent
935c8e32da
commit
d9adc91256
4 files changed
+123
-13
No files matched your search
@@ -59,6 +59,21 @@ module.exports.writeDataSimple = ( db, column, searchQuery, data ) => {
|
||||
} );
|
||||
};
|
||||
|
||||
module.exports.checkDataAvailability = ( db, column, searchQuery ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
dbh.query( { 'command': 'checkDataAvailability', 'property': column, 'searchQuery': searchQuery }, dbRef[ db ] ).then( res => {
|
||||
if ( res.length > 0 ) {
|
||||
resolve( true );
|
||||
} else {
|
||||
resolve( false );
|
||||
}
|
||||
} ).catch( error => {
|
||||
reject( error );
|
||||
} );
|
||||
} );
|
||||
};
|
||||
|
||||
|
||||
module.exports.getJSONData = ( file ) => {
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
fs.readFile( path.join( __dirname + '/data/' + file + '.json' ), ( error, data ) => {
|
||||
|
||||
Reference in new issue
Block a user