Skip to content

Commit

Permalink
Add predict form
Browse files Browse the repository at this point in the history
  • Loading branch information
pierrelefevre committed Jan 3, 2024
1 parent 1e89763 commit 35a9604
Show file tree
Hide file tree
Showing 7 changed files with 1,083,329 additions and 34 deletions.
11 changes: 7 additions & 4 deletions frontend/src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import { ThemeProvider } from "@emotion/react";
import { CssBaseline, createTheme } from "@mui/material";
import Router from "./Router";
import { BrowserRouter } from "react-router-dom";
import { ResourceContextProvider } from "./contexts/ResourceContext";

const theme = createTheme({
palette: {
Expand All @@ -21,10 +22,12 @@ const theme = createTheme({
function App() {
return (
<BrowserRouter>
<ThemeProvider theme={theme}>
<CssBaseline />
<Router />
</ThemeProvider>
<ResourceContextProvider>
<ThemeProvider theme={theme}>
<CssBaseline />
<Router />
</ThemeProvider>
</ResourceContextProvider>
</BrowserRouter>
);
}
Expand Down
8 changes: 8 additions & 0 deletions frontend/src/api/api.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@ export const getListings = async (n, skip) => {
return data;
};

export const getLocations = async () => {
const response = await fetch(api_url + "/locations");
const data = await response.json();

return data;
}


export const predict = async (listing) => {
const response = await fetch(api_url + "/predict", {
method: "POST",
Expand Down
Loading

0 comments on commit 35a9604

Please sign in to comment.