updates
This commit is contained in:
parent
d0a64858ec
commit
152fd56301
@ -95,6 +95,7 @@ module.exports = async function add({ dbFullName, tableName, data, tableSchema,
|
||||
let insertValuesArray = [];
|
||||
|
||||
for (let i = 0; i < dataKeys.length; i++) {
|
||||
try {
|
||||
const dataKey = dataKeys[i];
|
||||
let value = data[dataKey];
|
||||
|
||||
@ -108,7 +109,7 @@ module.exports = async function add({ dbFullName, tableName, data, tableSchema,
|
||||
}
|
||||
|
||||
if (targetFieldSchema?.richText) {
|
||||
value = sanitizeHtml(value, sanitizeHtmlOptions).replace(/\n|\r|\n\r/gm, "");
|
||||
value = sanitizeHtml(value, sanitizeHtmlOptions);
|
||||
}
|
||||
|
||||
insertKeysArray.push("`" + dataKey + "`");
|
||||
@ -118,6 +119,9 @@ module.exports = async function add({ dbFullName, tableName, data, tableSchema,
|
||||
}
|
||||
|
||||
insertValuesArray.push(value);
|
||||
} catch (error) {
|
||||
console.log("Error in add DB try catch block =>", error.message);
|
||||
}
|
||||
}
|
||||
|
||||
/** ********************************************** */
|
||||
|
@ -24,7 +24,7 @@ const handler = require("../utils/handler");
|
||||
*
|
||||
* @returns {Promise<object|null>}
|
||||
*/
|
||||
module.exports = async function deleteDb({ dbFullName, tableName, tableSchema, identifierColumnName, identifierValue, dbHost, dbPassword, dbUsername, encryptionKey, encryptionSalt }) {
|
||||
module.exports = async function deleteDb({ dbFullName, tableName, identifierColumnName, identifierValue, dbHost, dbPassword, dbUsername, encryptionKey, encryptionSalt }) {
|
||||
try {
|
||||
/**
|
||||
* Check if data is valid
|
||||
@ -50,7 +50,6 @@ module.exports = async function deleteDb({ dbFullName, tableName, tableSchema, i
|
||||
dbUsername,
|
||||
encryptionKey,
|
||||
encryptionSalt,
|
||||
tableSchema,
|
||||
});
|
||||
|
||||
////////////////////////////////////////
|
||||
|
Loading…
Reference in New Issue
Block a user