diff --git a/front-end/src/components/molecules/add-result.js b/front-end/src/components/molecules/add-result.js index 6e9ce17..b6a790a 100644 --- a/front-end/src/components/molecules/add-result.js +++ b/front-end/src/components/molecules/add-result.js @@ -3,7 +3,7 @@ import config from "../../../config.js"; import {globalBus} from "../../utils/events.js"; -const FETCH_URL = `${config['publicApiURL']}crawler/fetch?` +const FETCH_URL = '/app/fetch?' const template = () => /*html*/` @@ -56,7 +56,7 @@ export default define('add-result', class extends HTMLDivElement { const url = `${FETCH_URL}url=${encodeURIComponent(value)}&query=${encodeURIComponent(query)}`; const response = await fetch(url); if (response.status === 200) { - const data = await response.json(); + const data = await response.text(); console.log("Data", data); const addResultEvent = new CustomEvent('curate-add-result', {detail: data}); diff --git a/front-end/src/components/organisms/results.js b/front-end/src/components/organisms/results.js index d466c49..ce97295 100644 --- a/front-end/src/components/organisms/results.js +++ b/front-end/src/components/organisms/results.js @@ -115,15 +115,7 @@ class ResultsHandler { console.log("Add result", e); this.__beginCurating(); const resultData = e.detail; - const resultHTML = /*html*/` -
- `; - this.results.insertAdjacentHTML('afterbegin', resultHTML); + this.results.insertAdjacentHTML('afterbegin', resultData); const newResults = this.__getResults(); diff --git a/front-end/src/index.html b/front-end/src/index.html index 74e9a21..a08e557 100644 --- a/front-end/src/index.html +++ b/front-end/src/index.html @@ -102,7 +102,7 @@ - +