Updates
This commit is contained in:
@@ -3,7 +3,7 @@ require("dotenv").config({ path: "../../../.env" });
|
||||
import fs from "fs";
|
||||
import { execSync } from "child_process";
|
||||
import EJSON from "../../../utils/ejson";
|
||||
import DB_HANDLER from "../../../utils/backend/global-db/DB_HANDLER";
|
||||
import dbHandler from "../../../functions/backend/dbHandler";
|
||||
import addDbEntry from "../../../functions/backend/db/addDbEntry";
|
||||
import addMariadbUser from "../../../functions/backend/addMariadbUser";
|
||||
import updateDbEntry from "../../../functions/backend/db/updateDbEntry";
|
||||
@@ -63,9 +63,9 @@ async function createUser() {
|
||||
password: password,
|
||||
});
|
||||
|
||||
let existingUser = await DB_HANDLER(
|
||||
`SELECT * FROM users WHERE email='${email}'`
|
||||
);
|
||||
let existingUser = (await dbHandler({
|
||||
query: `SELECT * FROM users WHERE email='${email}'`,
|
||||
})) as any[];
|
||||
|
||||
if (existingUser?.[0]) {
|
||||
console.log("User Exists");
|
||||
@@ -170,7 +170,7 @@ async function createUser() {
|
||||
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
global.ERROR_CALLBACK?.(`Error Creating User`, error as Error);
|
||||
console.log("Error =\u003e", error.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -56,7 +56,7 @@ async function createUser() {
|
||||
|
||||
return true;
|
||||
} catch (error: any) {
|
||||
global.ERROR_CALLBACK?.(`Error Updating User`, error as Error);
|
||||
console.log("Error =\u003e", error.message);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user