Skip to content

Commit

Permalink
Migrate openResult method to SearchResult component
Browse files Browse the repository at this point in the history
After moving the `SearchResult` to its own component and leaving
 out the openResult method, the search results do not lead anywhere but
 but error out.

Signed-off-by: fenn-cs <fenn25.fn@gmail.com>
  • Loading branch information
nfebe committed Nov 28, 2023
1 parent 3365c87 commit 0710327
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
7 changes: 6 additions & 1 deletion core/src/components/GlobalSearch/SearchResult.vue
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<NcListItem class="result-items__item"
:name="title"
:bold="false"
@click="openResult(result)">
@click="openResult(resourceUrl)">
<template #icon>
<div aria-hidden="true"
class="result-items__item-icon"
Expand Down Expand Up @@ -91,6 +91,11 @@ export default {
thumbnailErrorHandler() {
this.thumbnailHasError = true
},
openResult(url) {
if (url) {
window.location = url
}
},
},
}
</script>
Expand Down
5 changes: 0 additions & 5 deletions core/src/views/GlobalSearchModal.vue
Original file line number Diff line number Diff line change
Expand Up @@ -341,11 +341,6 @@ export default {
})
this.results = sortedResults
},
openResult(result) {
if (result.resourceUrl) {
window.location = result.resourceUrl
}
},
mapContacts(contacts) {
return contacts.map(contact => {
return {
Expand Down

0 comments on commit 0710327

Please sign in to comment.