Skip to content

Commit

Permalink
apollo
Browse files Browse the repository at this point in the history
  • Loading branch information
joocer committed Mar 27, 2024
1 parent 32abf54 commit 0305753
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async def get_relations(token: str):
opteryx.query_to_arrow(cross, {"item": token}, limit=1).num_rows
> 0
):
response.append({"class": nid, "search": cross.replace(":item", "'" + token + "'")})
response.append({"class": target, "search": cross.replace(":item", "'" + token + "'")})

return response

Expand Down
15 changes: 14 additions & 1 deletion src/static/dist/js/apollo.js
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,23 @@ document.getElementById("assistantButton").addEventListener("click", function ()

suggestion_container.innerHTML = type_suggestion;

let other_suggestions = ""

apollo_api.get("v1/relations", null, { token: prompt }).then(data => {
console.log(data);
for (let i = 0; i++; i < data.length) {
console.log(data[i])
console.log(data[i]);
let item = data[i]
other_suggestions += `
<div class="card">
<div class="card-body">
<h5 class="card-title">Related ITems</h5>
<p class="card-text">
This ${data.class} has related ${item.class} entries
<code>${item.search}</code>
</p>
</div>
</div>`
}
});
}
Expand Down

0 comments on commit 0305753

Please sign in to comment.