Updates
This commit is contained in:
@@ -33,8 +33,6 @@ async function createUser() {
|
||||
if (typeof userObj !== "object" || Array.isArray(userObj))
|
||||
throw new Error("User Object Invalid!");
|
||||
|
||||
console.log("userObj", userObj);
|
||||
|
||||
const ROOT_DIR = path.resolve(__dirname, "../../../");
|
||||
|
||||
/**
|
||||
@@ -114,6 +112,15 @@ async function createUser() {
|
||||
"utf8"
|
||||
);
|
||||
|
||||
const imageBasePath = path.join(
|
||||
STATIC_ROOT,
|
||||
`images/user-images/user-${newUser.insertId}`
|
||||
);
|
||||
|
||||
if (!fs.existsSync(imageBasePath)) {
|
||||
fs.mkdirSync(imageBasePath, { recursive: true });
|
||||
}
|
||||
|
||||
let imagePath = path.join(
|
||||
STATIC_ROOT,
|
||||
`images/user-images/user-${newUser.insertId}/user-${newUser.insertId}-profile.jpg`
|
||||
|
||||
Reference in New Issue
Block a user