Strategy pattern in backend (mock for patent and projects for now)
This commit is contained in:
@@ -38,6 +38,18 @@ export class SearchResultsStateService {
|
||||
() => this._payload()?.manualKeywords ?? [],
|
||||
);
|
||||
|
||||
// Compute parallel keywords and topic names for trend dashboard strategies
|
||||
readonly keywordsList = computed(() => this.keywords());
|
||||
readonly topicsList = computed(() => {
|
||||
const ext = this.extractedKeywords();
|
||||
const man = this.manualKeywords();
|
||||
const all = [...ext, ...man];
|
||||
return this.keywords().map((kw) => {
|
||||
const match = all.find((e) => e.llm_keyword?.keyword === kw);
|
||||
return match?.topic_mapping?.topic?.display_name ?? kw;
|
||||
});
|
||||
});
|
||||
|
||||
setPayload(payload: SearchResultsPayload): void {
|
||||
this._payload.set(payload);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user