feat: set field as custom object label identifier in Object Detail (#3360)
* feat: set field as custom object label identifier in Object Detail Closes #3302 * feat: prevent disabling Object label identitifer field in back-end * refactor: review - extract isLabelIdentifier variable
This commit is contained in:
@ -186,6 +186,14 @@ export class FieldMetadataService extends TypeOrmQueryService<FieldMetadataEntit
|
||||
throw new NotFoundException('Object does not exist');
|
||||
}
|
||||
|
||||
if (
|
||||
objectMetadata.labelIdentifierFieldMetadataId ===
|
||||
existingFieldMetadata.id &&
|
||||
fieldMetadataInput.isActive === false
|
||||
) {
|
||||
throw new BadRequestException('Cannot deactivate label identifier field');
|
||||
}
|
||||
|
||||
// Check if the id of the options has been provided
|
||||
if (fieldMetadataInput.options) {
|
||||
for (const option of fieldMetadataInput.options) {
|
||||
|
||||
Reference in New Issue
Block a user