Skip to content

Commit

Permalink
Removed build directory from version control
Browse files Browse the repository at this point in the history
  • Loading branch information
vincenthphung committed Jun 20, 2023
1 parent a10cc7f commit 6fd618f
Show file tree
Hide file tree
Showing 16 changed files with 14 additions and 167 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,5 @@ dist
.DS_Store
Thumbs.db
.vercel
build

6 changes: 5 additions & 1 deletion api/search.js
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
// /api/search.js
const axios = require('axios');

module.exports = (req, res) => {
const apiKey = process.env.API_KEY;
const { term, location, sort_by } = req.query;

console.log('API Key:', apiKey); // add this line
console.log('Request query params:', req.query); // and this line

axios({
method: 'get',
url: `https://api.yelp.com/v3/businesses/search?term=${term}&location=${location}&sort_by=${sort_by}`,
Expand All @@ -13,9 +15,11 @@ module.exports = (req, res) => {
},
})
.then((response) => {
console.log('Yelp API response:', response.data); // and this line
res.send(response.data);
})
.catch((error) => {
console.log('Yelp API error:', error); // and this line
res.status(error.response.status);
res.send(error.response.data);
});
Expand Down
15 changes: 0 additions & 15 deletions build/asset-manifest.json

This file was deleted.

Binary file removed build/favicon.ico
Binary file not shown.
28 changes: 0 additions & 28 deletions build/index.html

This file was deleted.

15 changes: 0 additions & 15 deletions build/manifest.json

This file was deleted.

2 changes: 0 additions & 2 deletions build/static/css/main.62f3928e.css

This file was deleted.

1 change: 0 additions & 1 deletion build/static/css/main.62f3928e.css.map

This file was deleted.

3 changes: 0 additions & 3 deletions build/static/js/main.b75d2832.js

This file was deleted.

39 changes: 0 additions & 39 deletions build/static/js/main.b75d2832.js.LICENSE.txt

This file was deleted.

1 change: 0 additions & 1 deletion build/static/js/main.b75d2832.js.map

This file was deleted.

Binary file not shown.
Binary file not shown.
1 change: 1 addition & 0 deletions public/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
href="https://fonts.googleapis.com/css?family=Poppins:600"
rel="stylesheet"
/>
<link rel="stylesheet" href="reset.css" />
<!--
manifest.json provides metadata used when your web app is added to the
homescreen on Android. See https://developers.google.com/web/fundamentals/engage-and-retain/web-app-manifest/
Expand Down
44 changes: 0 additions & 44 deletions server.js

This file was deleted.

25 changes: 7 additions & 18 deletions src/utils/Yelp.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
const serverUrl = process.env.NODE_ENV === 'production' ? '/api' : 'http://localhost:3000';




const Yelp = {
search(term, location, sortBy) {
return fetch(
`${serverUrl}/search?term=${term}&location=${location}&sort_by=${sortBy}`
)
const url = `${serverUrl}/search?term=${term}&location=${location}&sort_by=${sortBy}`;

console.log('Request URL:', url); // add this line

return fetch(url)
.then((response) => {
if (!response.ok) {
throw new Error(`Yelp API error: ${response.statusText}`);
Expand All @@ -19,24 +18,14 @@ const Yelp = {

if (jsonResponse.businesses) {
return jsonResponse.businesses.map((business) => ({
id: business.id,
imageSrc: business.image_url,
name: business.name,
address: business.location.address1,
city: business.location.city,
state: business.location.state,
zipCode: business.location.zip_code,
category: business.categories[0].title,
rating: business.rating,
reviewCount: business.review_count,
url: business.url, // Add this line
// ... (rest of your code)
}));
} else {
return [];
}
})
.catch((error) => {
console.error('Error occurred during Yelp API call:', error);
console.error('Error occurred during Yelp API call:', error); // modify this line
return [];
});
},
Expand Down

1 comment on commit 6fd618f

@vercel
Copy link

@vercel vercel bot commented on 6fd618f Jun 20, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.