mirror of
https://github.com/paperless-ngx/paperless-ngx.git
synced 2025-12-10 00:35:30 +01:00
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:
parent
342fb9c421
commit
a2082257df
2 changed files with 2 additions and 2 deletions
|
|
@ -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)
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue