fix: ensure consistent type handling for suggestions in AI components

Updated ai-suggestions-panel.component.ts and document-detail.component.ts to convert suggestion values to strings, enhancing type safety and preventing potential runtime errors. This change ensures that all suggestion values are consistently treated as strings across the application.
This commit is contained in:
dawnsystem 2025-11-16 02:07:01 +01:00
parent 342fb9c421
commit a2082257df
2 changed files with 2 additions and 2 deletions

View file

@ -230,7 +230,7 @@ export class AiSuggestionsPanelComponent implements OnChanges, OnDestroy {
return new Date(suggestion.value).toLocaleDateString()
case AISuggestionType.Title:
return suggestion.value
return String(suggestion.value)
default:
return String(suggestion.value)

View file

@ -1657,7 +1657,7 @@ export class DocumentDetailComponent
case AISuggestionType.Date:
const dateAdapter = new ISODateAdapter()
const dateValue = dateAdapter.fromModel(suggestion.value)
const dateValue = dateAdapter.fromModel(String(suggestion.value))
this.documentForm.get('created').setValue(dateValue)
this.documentForm.get('created').markAsDirty()
break