Skip to content

Commit 1b389be

Browse files
author
Patrick Klein
committed
Use User- and Portfolio-ID passed by the plugin infrastructure.
1 parent b18ab33 commit 1b389be

File tree

2 files changed

+4
-7
lines changed

2 files changed

+4
-7
lines changed

.production.env

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
RECOMMENDATION_ENDPOINT=http://localhost:8080/api/recommend/
2+
FEEDBACK_ENDPOINT=http://localhost:8080/api/recommend/

src/index.js

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4,15 +4,10 @@ import habitat from 'preact-habitat'
44
import RecommendedStocksWidget from "./components/recommended-stocks";
55
const { render } = habitat(RecommendedStocksWidget);
66

7-
const props = {
8-
"user": 12345678,
9-
"portfolio": 87654321
10-
};
11-
127
function renderStockRecommendation(root_elem, user_id, portfolio_id) {
138
// Set properties
14-
root_elem.dataset.propUser = props.user;
15-
root_elem.dataset.propPortfolio = props.portfolio;
9+
root_elem.dataset.propUser = user_id;
10+
root_elem.dataset.propPortfolio = portfolio_id;
1611
render({
1712
selector: `#${root_elem.id}`
1813
});

0 commit comments

Comments
 (0)