adapter tests
Some checks failed
Some checks failed
This commit is contained in:
@@ -7,7 +7,14 @@ export class TypeOrmAdminSchemaError extends Error {
|
||||
message: string;
|
||||
},
|
||||
) {
|
||||
super(`[TypeOrmAdminSchemaError] ${details.entityName}.${details.fieldName}: ${details.reason} - ${details.message}`);
|
||||
super('');
|
||||
this.name = 'TypeOrmAdminSchemaError';
|
||||
|
||||
// Override the message property to be dynamic
|
||||
Object.defineProperty(this, 'message', {
|
||||
get: () => `[TypeOrmAdminSchemaError] ${this.details.entityName}.${this.details.fieldName}: ${this.details.reason} - ${this.details.message}`,
|
||||
enumerable: true,
|
||||
configurable: true,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ export function assertOptionalString(entityName: string, fieldName: string, valu
|
||||
if (value === null || value === undefined) {
|
||||
return;
|
||||
}
|
||||
if (typeof value !== 'string') {
|
||||
if (typeof value !== 'string' || value.trim().length === 0) {
|
||||
throw new TypeOrmAdminSchemaError({
|
||||
entityName,
|
||||
fieldName,
|
||||
|
||||
Reference in New Issue
Block a user