Updates
This commit is contained in:
@@ -6,6 +6,7 @@ import addDbEntry from "../../backend/db/addDbEntry";
|
||||
import updateUsersTableSchema from "../../backend/updateUsersTableSchema";
|
||||
import varDatabaseDbHandler from "../../backend/varDatabaseDbHandler";
|
||||
import hashPassword from "../../dsql/hashPassword";
|
||||
import validateEmail from "../../email/fns/validate-email";
|
||||
|
||||
/**
|
||||
* # API Create User
|
||||
@@ -118,6 +119,16 @@ export default async function apiCreateUser({
|
||||
};
|
||||
}
|
||||
|
||||
const isEmailValid = await validateEmail({ email: payload.email });
|
||||
|
||||
if (!isEmailValid.isValid) {
|
||||
return {
|
||||
success: false,
|
||||
msg: isEmailValid.message,
|
||||
payload: null,
|
||||
};
|
||||
}
|
||||
|
||||
const addUser = await addDbEntry({
|
||||
dbFullName: dbFullName,
|
||||
tableName: "users",
|
||||
|
||||
Reference in New Issue
Block a user