Updates
This commit is contained in:
@@ -64,7 +64,7 @@ export default async function checkDbRecordCreateDbSchema({
|
||||
forceLocal: true,
|
||||
});
|
||||
|
||||
if (newDbEntry.payload?.insertId) {
|
||||
if (newDbEntry.postInsertReturn?.insertId) {
|
||||
recordedDbEntryArray = (await dbHandler({
|
||||
query: `SELECT * FROM datasquirel.user_databases WHERE db_full_name = ?`,
|
||||
values: [dbFullName || "NULL"],
|
||||
|
||||
@@ -97,7 +97,7 @@ export default async function checkTableRecordCreateDbSchema({
|
||||
forceLocal: true,
|
||||
});
|
||||
|
||||
if (newTableRecordEntry.payload?.insertId) {
|
||||
if (newTableRecordEntry.postInsertReturn?.insertId) {
|
||||
recordedTableEntryArray = (await dbHandler({
|
||||
query: queryObj?.string || "",
|
||||
values: queryObj?.values,
|
||||
|
||||
@@ -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,
|
||||
|
||||
@@ -97,8 +97,8 @@ export default async function ({
|
||||
dbFullName: targetDatabase,
|
||||
});
|
||||
|
||||
if (newTableEntryRes?.payload?.insertId) {
|
||||
tableId = newTableEntryRes.payload.insertId;
|
||||
if (newTableEntryRes?.postInsertReturn?.insertId) {
|
||||
tableId = newTableEntryRes.postInsertReturn.insertId;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user