Updates
This commit is contained in:
@@ -85,7 +85,7 @@ export default async function addUsersTableToDb({
|
||||
|
||||
return `Done!`;
|
||||
} catch (/** @type {any} */ error: any) {
|
||||
console.log(`addUsersTableToDb.js ERROR: ${error.message}`);
|
||||
console.log(`addUsersTableToDb.ts ERROR: ${error.message}`);
|
||||
|
||||
serverError({
|
||||
component: "addUsersTableToDb",
|
||||
|
||||
@@ -6,7 +6,7 @@ import _ from "lodash";
|
||||
* @description this function takes in a text(or number) and returns a sanitized
|
||||
* text, usually without spaces
|
||||
*/
|
||||
function sanitizeSql(text: any, spaces: boolean, regex?: RegExp | null): any {
|
||||
function sanitizeSql(text: any, spaces?: boolean, regex?: RegExp | null): any {
|
||||
if (!text) return "";
|
||||
if (typeof text == "number" || typeof text == "boolean") return text;
|
||||
if (typeof text == "string" && !text?.toString()?.match(/./)) return "";
|
||||
@@ -55,7 +55,7 @@ function sanitizeSql(text: any, spaces: boolean, regex?: RegExp | null): any {
|
||||
*
|
||||
* @returns {object}
|
||||
*/
|
||||
function sanitizeObjects(object: any, spaces: boolean): object {
|
||||
function sanitizeObjects(object: any, spaces?: boolean): object {
|
||||
/** @type {any} */
|
||||
let objectUpdated: any = { ...object };
|
||||
const keys = Object.keys(objectUpdated);
|
||||
@@ -92,7 +92,7 @@ function sanitizeObjects(object: any, spaces: boolean): object {
|
||||
*/
|
||||
function sanitizeArrays(
|
||||
array: any[],
|
||||
spaces: boolean
|
||||
spaces?: boolean
|
||||
): string[] | number[] | object[] {
|
||||
let arrayUpdated = _.cloneDeep(array);
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ export default function grabNewUsersTableSchema(params: {
|
||||
|
||||
return userPreset;
|
||||
} catch (/** @type {any} */ error: any) {
|
||||
console.log(`grabNewUsersTableSchema.js ERROR: ${error.message}`);
|
||||
console.log(`grabNewUsersTableSchema.ts ERROR: ${error.message}`);
|
||||
|
||||
serverError({
|
||||
component: "grabNewUsersTableSchema",
|
||||
|
||||
@@ -75,10 +75,10 @@ export default function grabSchemaFieldsFromData({
|
||||
|
||||
return finalFields;
|
||||
} catch (/** @type {any} */ error: any) {
|
||||
console.log(`grabSchemaFieldsFromData.js ERROR: ${error.message}`);
|
||||
console.log(`grabSchemaFieldsFromData.ts ERROR: ${error.message}`);
|
||||
|
||||
serverError({
|
||||
component: "grabSchemaFieldsFromData.js",
|
||||
component: "grabSchemaFieldsFromData.ts",
|
||||
message: error.message,
|
||||
});
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import fs from "fs";
|
||||
import nodemailer, { SendMailOptions } from "nodemailer";
|
||||
import nodemailer from "nodemailer";
|
||||
|
||||
let transporter = nodemailer.createTransport({
|
||||
host: process.env.DSQL_MAIL_HOST,
|
||||
@@ -68,7 +68,7 @@ export default async function handleNodemailer({
|
||||
////////////////////////////////////////
|
||||
|
||||
try {
|
||||
let mailObject: SendMailOptions = {};
|
||||
let mailObject: any = {};
|
||||
|
||||
mailObject["from"] = `"${senderName || "Datasquirel"}" <${sender}>`;
|
||||
mailObject["sender"] = sender;
|
||||
|
||||
@@ -65,7 +65,7 @@ export default async function updateUsersTableSchema({
|
||||
|
||||
return `Done!`;
|
||||
} catch (error: any) {
|
||||
console.log(`addUsersTableToDb.js ERROR: ${error.message}`);
|
||||
console.log(`addUsersTableToDb.ts ERROR: ${error.message}`);
|
||||
|
||||
serverError({
|
||||
component: "addUsersTableToDb",
|
||||
|
||||
Reference in New Issue
Block a user