From 246dafb64dad0624beb47e171777352e6454953b Mon Sep 17 00:00:00 2001 From: Manish Kushare <37823141+manishkushare@users.noreply.github.com> Date: Thu, 3 Apr 2025 11:59:50 +0530 Subject: [PATCH] Fix: In TJDB the error message text not having proper column name while uploading bulk data (#12346) * Fix: In TJDB the error message text not having proper column name while uploading bulk data * Change the variable name and removed capitalize loadsh method --- server/src/modules/tooljet-db/types.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/src/modules/tooljet-db/types.ts b/server/src/modules/tooljet-db/types.ts index 73b72013aa..86f0f4ec8c 100644 --- a/server/src/modules/tooljet-db/types.ts +++ b/server/src/modules/tooljet-db/types.ts @@ -1,6 +1,5 @@ import { QueryFailedError } from 'typeorm'; import { InternalTable } from 'src/entities/internal_table.entity'; -import { capitalize } from 'lodash'; export const TJDB = { character_varying: 'character varying' as const, @@ -150,10 +149,11 @@ export class TooljetDatabaseError extends QueryFailedError { } toString(): string { + const capitalizeSentence = (str: string) => str.charAt(0).toUpperCase() + str.slice(1); const errorMessage = errorCodeMapping[this.code]?.[this.context.origin] || errorCodeMapping[this.code]?.['default'] || - capitalize(this.message); + capitalizeSentence(this.message); return this.replaceErrorPlaceholders(errorMessage); }