Skip to content

Commit

Permalink
fix: update to new names
Browse files Browse the repository at this point in the history
  • Loading branch information
safwansamsudeen committed Feb 11, 2024
1 parent f98dff1 commit 9fadf9b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
8 changes: 8 additions & 0 deletions wiki/hooks.py
Original file line number Diff line number Diff line change
Expand Up @@ -167,3 +167,11 @@
"extras": ["route"],
},
}

frappe_search_doctypes = {
"Wiki Page": {
"title": "title",
"content": ["content"],
"fields": ["route"],
},
}
5 changes: 2 additions & 3 deletions wiki/public/js/render_wiki.js
Original file line number Diff line number Diff line change
Expand Up @@ -599,7 +599,7 @@ window.RenderWiki = class RenderWiki extends Wiki {

frappe
.call({
method: "frappe_search.core.search",
method: "frappe_search.api.search",
args: {
query: searchInput.val(),
path: window.location.pathname,
Expand All @@ -612,10 +612,9 @@ window.RenderWiki = class RenderWiki extends Wiki {
if (results.length === 0) {
dropdown_html = `<div style="margin: 1.5rem 9rem;">No results found</div>`;
} else {
console.log(results);
dropdown_html = results
.map((r) => {
return `<a class="dropdown-item" href="/${r.extras.route}">
return `<a class="dropdown-item" href="/${r.fields.route}">
<h6>${r.highlighted_title || r.title}</h6>
<div>${
res.message.search_engine === "frappe_web_search"
Expand Down

0 comments on commit 9fadf9b

Please sign in to comment.