Updates
This commit is contained in:
@@ -17,7 +17,7 @@ require("dotenv").config({ path: "../../../.env" });
|
||||
const fs_1 = __importDefault(require("fs"));
|
||||
const child_process_1 = require("child_process");
|
||||
const ejson_1 = __importDefault(require("../../../utils/ejson"));
|
||||
const DB_HANDLER_1 = __importDefault(require("../../../utils/backend/global-db/DB_HANDLER"));
|
||||
const dbHandler_1 = __importDefault(require("../../../functions/backend/dbHandler"));
|
||||
const addDbEntry_1 = __importDefault(require("../../../functions/backend/db/addDbEntry"));
|
||||
const addMariadbUser_1 = __importDefault(require("../../../functions/backend/addMariadbUser"));
|
||||
const updateDbEntry_1 = __importDefault(require("../../../functions/backend/db/updateDbEntry"));
|
||||
@@ -29,7 +29,7 @@ const tmpDir = process.argv[process.argv.length - 1];
|
||||
*/
|
||||
function createUser() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var _a, _b;
|
||||
var _a;
|
||||
/**
|
||||
* Validate Form
|
||||
*
|
||||
@@ -67,7 +67,9 @@ function createUser() {
|
||||
encryptionKey: process.env.DSQL_ENCRYPTION_PASSWORD || "",
|
||||
password: password,
|
||||
});
|
||||
let existingUser = yield (0, DB_HANDLER_1.default)(`SELECT * FROM users WHERE email='${email}'`);
|
||||
let existingUser = (yield (0, dbHandler_1.default)({
|
||||
query: `SELECT * FROM users WHERE email='${email}'`,
|
||||
}));
|
||||
if (existingUser === null || existingUser === void 0 ? void 0 : existingUser[0]) {
|
||||
console.log("User Exists");
|
||||
return false;
|
||||
@@ -128,7 +130,7 @@ function createUser() {
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
(_b = global.ERROR_CALLBACK) === null || _b === void 0 ? void 0 : _b.call(global, `Error Creating User`, error);
|
||||
console.log("Error =\u003e", error.message);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -24,7 +24,6 @@ const tmpDir = process.argv[process.argv.length - 1];
|
||||
*/
|
||||
function createUser() {
|
||||
return __awaiter(this, void 0, void 0, function* () {
|
||||
var _a;
|
||||
/**
|
||||
* Validate Form
|
||||
*
|
||||
@@ -66,7 +65,7 @@ function createUser() {
|
||||
return true;
|
||||
}
|
||||
catch (error) {
|
||||
(_a = global.ERROR_CALLBACK) === null || _a === void 0 ? void 0 : _a.call(global, `Error Updating User`, error);
|
||||
console.log("Error =\u003e", error.message);
|
||||
return false;
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user