Skip to content

Commit

Permalink
fix(search): fix article search returning nothing when pasting url
Browse files Browse the repository at this point in the history
  • Loading branch information
devformatters authored and Zeck Li committed Nov 6, 2020
1 parent 7a22887 commit f6fc5f6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/connectors/articleService.ts
Original file line number Diff line number Diff line change
Expand Up @@ -461,7 +461,11 @@ export class ArticleService extends BaseService {
const re = /^([0-9a-zA-Z]{49,59})$/gi
const match = re.exec(key)
if (match) {
return this.searchByMediaHash({ key: match[1], oss, filter })
const matched = await this.searchByMediaHash({ key: match[1], oss, filter })
const items = await this.draftLoader.loadMany(
matched.nodes.map(item => item.id)
)
return { nodes: items, totalCount: matched.totalCount }
}

// take the condition that searching for exact article title into consideration
Expand Down

0 comments on commit f6fc5f6

Please sign in to comment.