Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions src/config/database.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ require("env2")(".env");
const Sequelize = require("sequelize");

class Database {

constructor() {
if (Database._instance) {
throw new Error(
Expand All @@ -28,13 +28,14 @@ class Database {
} catch (error) {
console.error("Unable to connect to the database:", error);
}
}

Database._instance = this;
}

static getInstance() {
return Database._instance;
static getInstance() {
if (!this._instance){
this._instance = new Database();
}
return this._instance;
}

parseSSLEnvVar() {
this.sequelize_ssl = process.env.SEQUELIZE_SSL.toLowerCase();
Expand Down Expand Up @@ -398,6 +399,7 @@ class Database {
type: this.sequelize.QueryTypes.INSERT,
}
);
console.log({result});
return result;
}
catch(err){
Expand Down
4 changes: 2 additions & 2 deletions src/lib/sms.js
Original file line number Diff line number Diff line change
Expand Up @@ -416,7 +416,7 @@ class Sms {
parameterCountMatch(command, parameterObj) {
if (
parameterObj.commandArray.length == 1 &&
command.commandName == "manual"
command.name == "manual"
) {
return true;
} else {
Expand All @@ -436,7 +436,7 @@ class Sms {
if (!this.parameterCountMatch(command, parameterObj)) {
responseValue =
"Incorrect syntax for '" +
command.commandName +
command.name +
"':\n" +
command.parameterUsage;
return responseValue;
Expand Down