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
This commit is contained in:
Manish Kushare 2025-04-03 11:59:50 +05:30 committed by GitHub
parent b6b89c0b90
commit 246dafb64d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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);
}