diff --git a/frontend/src/pages/Discover.tsx b/frontend/src/pages/Discover.tsx index 9205188a..6dc187be 100644 --- a/frontend/src/pages/Discover.tsx +++ b/frontend/src/pages/Discover.tsx @@ -19,7 +19,7 @@ function fetcher(url: string) { } const Discover: React.FC = () => { - const { data, error } = useSWR('http://localhost:3001/api/listings/nearby', fetcher); + const { data, error } = useSWR('https://storestash.herokuapp.com/api/listings/nearby', fetcher); let content; if (error) content =
failed to load
diff --git a/frontend/src/pages/Listing.tsx b/frontend/src/pages/Listing.tsx index 6f1b9502..8a69949e 100644 --- a/frontend/src/pages/Listing.tsx +++ b/frontend/src/pages/Listing.tsx @@ -60,7 +60,7 @@ const Listing: React.FC = (props) => e.preventDefault(); if (validate()) { try { - await wretch(`http://localhost:3001/api/listings/${listingId}/rent`) + await wretch(`https://storestash.herokuapp.com/api/listings/${listingId}/rent`) .post({ renter: userId, boxes, @@ -75,7 +75,7 @@ const Listing: React.FC = (props) => } } - const { data, error } = useSWR(`http://localhost:3001/api/listings/${listingId}`, url => wretch(url).get().json()); + const { data, error } = useSWR(`https://storestash.herokuapp.com/api/listings/${listingId}`, url => wretch(url).get().json()); let listing; if (!listingId || error) listing =
Failed to load
diff --git a/frontend/src/pages/Login.tsx b/frontend/src/pages/Login.tsx index 5122c9bb..e1d26cc2 100644 --- a/frontend/src/pages/Login.tsx +++ b/frontend/src/pages/Login.tsx @@ -34,7 +34,7 @@ const Login: React.SFC = (props) => { } try { // TODO: get authorization token - await wretch('http://localhost:3001/api/login') + await wretch('https://storestash.herokuapp.com/api/login') .post({ email, password }) .json(data => { console.log(data); diff --git a/frontend/src/pages/Post.tsx b/frontend/src/pages/Post.tsx index 79961b5a..cbbcf943 100644 --- a/frontend/src/pages/Post.tsx +++ b/frontend/src/pages/Post.tsx @@ -73,7 +73,7 @@ export default class Post extends React.Component { console.log(typeof price); console.log(typeof capacity); console.log(typeof today); - await wretch('http://localhost:3001/api/listings/new') + await wretch('https://storestash.herokuapp.com/api/listings/new') .post({ id, hostId, lat, lon, capacity, startDate: new Date(this.state.startDate), endDate: new Date(this.state.endDate), price, image: this.state.imageUrl }) .json(data => console.log(data)); this.props.history.push('/listing_confirmation') diff --git a/frontend/src/pages/Profile.tsx b/frontend/src/pages/Profile.tsx index 39d9aa09..fc487379 100644 --- a/frontend/src/pages/Profile.tsx +++ b/frontend/src/pages/Profile.tsx @@ -98,9 +98,9 @@ const Profile: React.FC = (props) => { // TODO: re-fetch on page load - const { data: listings, error: errorListings } = useSWR(userId ? `http://localhost:3001/api/users/${userId}/listings` : null, url => wretch(url).get().json()); - const { data: lendings, error: errorLendings } = useSWR(userId ? `http://localhost:3001/api/users/${userId}/lendings` : null, url => wretch(url).get().json()); - const { data: rentals, error: errorRentals } = useSWR(userId ? `http://localhost:3001/api/users/${userId}/rentals` : null, url => wretch(url).get().json()); + const { data: listings, error: errorListings } = useSWR(userId ? `https://storestash.herokuapp.com/api/users/${userId}/listings` : null, url => wretch(url).get().json()); + const { data: lendings, error: errorLendings } = useSWR(userId ? `https://storestash.herokuapp.com/api/users/${userId}/lendings` : null, url => wretch(url).get().json()); + const { data: rentals, error: errorRentals } = useSWR(userId ? `https://storestash.herokuapp.com/api/users/${userId}/rentals` : null, url => wretch(url).get().json()); if (!errorListings && listings) { listingsContent = listings.length > 0 ? listings.map(listing => ) : No listings (yet!) } diff --git a/frontend/src/pages/Register.tsx b/frontend/src/pages/Register.tsx index 7dc607cf..ade90c05 100644 --- a/frontend/src/pages/Register.tsx +++ b/frontend/src/pages/Register.tsx @@ -41,7 +41,7 @@ const Register: React.FC = (props) => { // TODO: get authorization token if (!validationErr) { try { - await wretch('http://localhost:3001/api/users/new') + await wretch('https://storestash.herokuapp.com/api/users/new') .post({ email, password: password1,