This commit is contained in:
2025-12-26 06:37:30 +01:00
parent 98aaa94b80
commit b02399c64d
50 changed files with 112 additions and 105 deletions
@@ -77,7 +77,7 @@ async function createUser() {
data: { ...userObj, password: hashedPassword },
});
if (!newUser?.payload?.insertId) return false;
if (!newUser?.postInsertReturn?.insertId) return false;
const { STATIC_ROOT } = grabDirNames();
@@ -91,10 +91,10 @@ async function createUser() {
*
* @description Create new user folder and file
*/
let newUserSchemaFolderPath = `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${newUser.payload.insertId}`;
let newUserSchemaFolderPath = `${process.env.DSQL_USER_DB_SCHEMA_PATH}/user-${newUser.postInsertReturn.insertId}`;
let newUserMediaFolderPath = path.join(
STATIC_ROOT,
`images/user-images/user-${newUser.payload.insertId}`
`images/user-images/user-${newUser.postInsertReturn.insertId}`
);
fs.mkdirSync(newUserSchemaFolderPath, { recursive: true });
@@ -108,7 +108,7 @@ async function createUser() {
const imageBasePath = path.join(
STATIC_ROOT,
`images/user-images/user-${newUser.payload.insertId}`
`images/user-images/user-${newUser.postInsertReturn.insertId}`
);
if (!fs.existsSync(imageBasePath)) {
@@ -117,12 +117,12 @@ async function createUser() {
let imagePath = path.join(
STATIC_ROOT,
`images/user-images/user-${newUser.payload.insertId}/user-${newUser.payload.insertId}-profile.jpg`
`images/user-images/user-${newUser.postInsertReturn.insertId}/user-${newUser.postInsertReturn.insertId}-profile.jpg`
);
let imageThumbnailPath = path.join(
STATIC_ROOT,
`images/user-images/user-${newUser.payload.insertId}/user-${newUser.payload.insertId}-profile-thumbnail.jpg`
`images/user-images/user-${newUser.postInsertReturn.insertId}/user-${newUser.postInsertReturn.insertId}-profile-thumbnail.jpg`
);
let prodImageUrl = imagePath.replace(
@@ -149,7 +149,7 @@ async function createUser() {
dbFullName: "datasquirel",
tableName: "users",
identifierColumnName: "id",
identifierValue: newUser.payload.insertId,
identifierValue: newUser.postInsertReturn.insertId,
data: {
image: prodImageUrl,
image_thumbnail: prodImageThumbnailUrl,