Minor Fix - issues in SearchRepository.propagateGlossaryTags method (#19995)

* Fix - issues in SearchRepository.propagateGlossaryTags method

* Refactor - format get_sample_query method for improved readability

---------

Co-authored-by: Ayush Shah <ayush@getcollate.io>
This commit is contained in:
sonika-shah 2025-02-27 11:38:53 +05:30 committed by GitHub
parent 851aa3ee0b
commit 88a4ce481f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -484,8 +484,7 @@ public class SearchRepository {
for (FieldChange field : changeDescription.getFieldsAdded()) {
if (propagateFields.contains(field.getName())) {
List<TagLabel> tagLabels =
JsonUtils.readObjects(
(String) changeDescription.getFieldsAdded().get(0).getNewValue(), TagLabel.class);
JsonUtils.readObjects((String) field.getNewValue(), TagLabel.class);
tagLabels.forEach(tagLabel -> tagLabel.setLabelType(TagLabel.LabelType.DERIVED));
fieldData.put("tagAdded", tagLabels);
}
@ -493,9 +492,7 @@ public class SearchRepository {
for (FieldChange field : changeDescription.getFieldsDeleted()) {
if (propagateFields.contains(field.getName())) {
List<TagLabel> tagLabels =
JsonUtils.readObjects(
(String) changeDescription.getFieldsDeleted().get(0).getOldValue(),
TagLabel.class);
JsonUtils.readObjects((String) field.getOldValue(), TagLabel.class);
tagLabels.forEach(tagLabel -> tagLabel.setLabelType(TagLabel.LabelType.DERIVED));
fieldData.put("tagDeleted", tagLabels);
}