mirror of
https://github.com/janishutz/libreevent.git
synced 2025-11-25 21:34:24 +00:00
various fixes
This commit is contained in:
@@ -1 +1 @@
|
||||
{"test4":{"secAr4s7":{"id":"secAr4s7","component":1,"ticketOption":"1","eventID":"test4","category":"1","name":"Row 5, Seat 8"}}}
|
||||
{"test4":{"secAr4s7":{"id":"secAr4s7","component":1,"ticketOption":"1","eventID":"test4","category":"1","name":"Row 5, Seat 8"},"secAr6s14":{"id":"secAr6s14","component":1,"ticketOption":"2","eventID":"test4","category":"1","name":"Row 7, Seat 15"}}}
|
||||
@@ -47,7 +47,6 @@ module.exports.getData = ( db ) => {
|
||||
};
|
||||
|
||||
module.exports.writeDataSimple = ( db, column, searchQuery, data ) => {
|
||||
console.log( 'writingData' );
|
||||
return new Promise( ( resolve, reject ) => {
|
||||
dbh.query( { 'command': 'checkDataAvailability', 'property': column, 'searchQuery': searchQuery }, dbRef[ db ] ).then( res => {
|
||||
if ( res.length > 0 ) {
|
||||
|
||||
@@ -19,7 +19,10 @@ class JSONDB {
|
||||
}
|
||||
|
||||
connect () {
|
||||
let data = JSON.parse( fs.readFileSync( path.join( __dirname + '/data/db.json' ) ) );
|
||||
let data = {};
|
||||
try {
|
||||
JSON.parse( fs.readFileSync( path.join( __dirname + '/data/db.json' ) ) );
|
||||
} catch ( err ) {}
|
||||
this.db = data[ 'db' ] ?? { 'libreevent_temp': {}, 'libreevent_admin': {}, 'libreevent_orders': {}, 'libreevent_users': {} };
|
||||
this.dbIndex = data[ 'index' ] ?? { 'libreevent_temp': 0, 'libreevent_admin': 0, 'libreevent_orders': 0, 'libreevent_users': 0 };
|
||||
this.db[ 'libreevent_temp' ] = {};
|
||||
|
||||
Reference in New Issue
Block a user