Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelefevre committed Jan 5, 2024
2 parents fc52da2 + 48809f3 commit a996ce3
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 12 deletions.
Binary file added frontend/public/marker-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added frontend/public/marker-shadow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
33 changes: 21 additions & 12 deletions frontend/src/pages/Predict.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,8 @@ const Predict = () => {
if (!Object.values(state).some((value) => value === "")) {
// Convert state to correct format for the API
const listing = {};
listing.latitude = parseFloat(state.latitude);
listing.longitude = parseFloat(state.longitude);
listing.lat = parseFloat(state.latitude);
listing.long = parseFloat(state.longitude);
listing.askingPrice = parseInt(state.askingPrice);
listing.fee = parseInt(state.fee);
listing.livingArea = parseInt(state.livingArea);
Expand All @@ -77,13 +77,6 @@ const Predict = () => {
listing.hasBalcony = state.hasBalcony;
listing.soldAt = new Date().toISOString().slice(0, 10);

// TODO: add coords in form, maybe pick from map? Or fetch from Hemnet API
listing.lat = 50;
listing.long = 50;

// Currently don't use asking price, maybe we will do it in the future
// listing.askingPrice = parseInt(state.askingPrice);

predict(listing)
.then((data) => {
setPredictedPrice(data.prediction);
Expand Down Expand Up @@ -113,8 +106,16 @@ const Predict = () => {
];

return (
<Stack spacing={2}>
<Card>
<Stack spacing={5}>
<Card
sx={{
border: 2,
borderColor: "#018e51",
borderRadius: 2,
boxShadow: 5,
p: 3,
}}
>
<CardHeader title="House information" />
<CardContent>
<Grid container spacing={2}>
Expand Down Expand Up @@ -317,7 +318,15 @@ const Predict = () => {
</CardContent>
</Card>

<Card>
<Card
sx={{
border: 2,
borderColor: "#018e51",
borderRadius: 2,
boxShadow: 5,
p: 3,
}}
>
<CardHeader title="Predicted price" />
<CardContent>
<Grid container spacing={2}>
Expand Down

0 comments on commit a996ce3

Please sign in to comment.