From 7af6d1603d28a0714365e5538c06403e2cb4054d Mon Sep 17 00:00:00 2001 From: Lyubov Voloshko Date: Fri, 5 Sep 2025 14:33:42 +0300 Subject: [PATCH] foreign key: check this.suggestions --- .../filter-fields/foreign-key/foreign-key.component.ts | 2 +- .../record-edit-fields/foreign-key/foreign-key.component.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts b/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts index adbdc3d7e..6d9df9c86 100644 --- a/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts +++ b/frontend/src/app/components/ui-components/filter-fields/foreign-key/foreign-key.component.ts @@ -116,7 +116,7 @@ export class ForeignKeyFilterComponent extends BaseFilterFieldComponent { } fetchSuggestions() { - const currentRow = this.suggestions.find(suggestion => suggestion.displayString === this.currentDisplayedString); + const currentRow = this.suggestions?.find(suggestion => suggestion.displayString === this.currentDisplayedString); if (currentRow !== undefined) { this.currentFieldValue = currentRow.fieldValue; // this.currentFieldQueryParams = Object.assign({}, ...this.primaeyKeys.map((primaeyKey) => ({[primaeyKey.column_name]: currentRow[primaeyKey.column_name]}))); diff --git a/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts b/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts index aeb9fd0fa..a52e2a16d 100644 --- a/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts +++ b/frontend/src/app/components/ui-components/record-edit-fields/foreign-key/foreign-key.component.ts @@ -124,7 +124,7 @@ export class ForeignKeyEditComponent extends BaseEditFieldComponent { } fetchSuggestions() { - const currentRow = this.suggestions.find(suggestion => suggestion.displayString === this.currentDisplayedString); + const currentRow = this.suggestions?.find(suggestion => suggestion.displayString === this.currentDisplayedString); if (currentRow !== undefined) { this.currentFieldValue = currentRow.fieldValue; // this.currentFieldQueryParams = Object.assign({}, ...this.primaeyKeys.map((primaeyKey) => ({[primaeyKey.column_name]: currentRow[primaeyKey.column_name]})));