@ -35,7 +35,7 @@ describe('FilterInputFactory', () => {
|
||||
};
|
||||
|
||||
expect(() => service.create(request, objectMetadata)).toThrow(
|
||||
"field 'wrongField' does not exist in 'testingObject' object",
|
||||
"field 'wrongField' does not exist in 'objectName' object",
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
@ -112,7 +112,7 @@ describe('OrderByInputFactory', () => {
|
||||
};
|
||||
|
||||
expect(() => service.create(request, objectMetadata)).toThrow(
|
||||
"field 'wrongField' does not exist in 'testingObject' object",
|
||||
"field 'wrongField' does not exist in 'objectName' object",
|
||||
);
|
||||
});
|
||||
});
|
||||
|
||||
@ -1,6 +1,7 @@
|
||||
import { BadRequestException } from '@nestjs/common';
|
||||
|
||||
import { FieldMetadataType } from 'src/metadata/field-metadata/field-metadata.entity';
|
||||
import { computeObjectTargetTable } from 'src/workspace/utils/compute-object-target-table.util';
|
||||
|
||||
export const getFieldType = (
|
||||
objectMetadataItem,
|
||||
@ -28,7 +29,9 @@ export const checkFields = (objectMetadataItem, fieldNames): void => {
|
||||
.includes(fieldName)
|
||||
) {
|
||||
throw new BadRequestException(
|
||||
`field '${fieldName}' does not exist in '${objectMetadataItem.targetTableName}' object`,
|
||||
`field '${fieldName}' does not exist in '${computeObjectTargetTable(
|
||||
objectMetadataItem,
|
||||
)}' object`,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user