Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
north108 committed Dec 19, 2019
2 parents 8076bb9 + b0bd62a commit 2b8f315
Show file tree
Hide file tree
Showing 7 changed files with 158 additions and 8 deletions.
146 changes: 146 additions & 0 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,13 @@
"name": "video-store-consumer",
"version": "0.1.0",
"private": true,
"homepage": "https://krismosk.github.io/video-store-consumer",
"dependencies": {
"@testing-library/jest-dom": "^4.2.4",
"@testing-library/react": "^9.4.0",
"axios": "^0.19.0",
"bootstrap": "^4.4.1",
"gh-pages": "^2.1.1",
"react": "^16.8.6",
"react-datetime": "^2.16.3",
"react-dom": "^16.8.6",
Expand All @@ -17,6 +19,8 @@
"start": "react-scripts start",
"build": "react-scripts build",
"test": "react-scripts test --env=jsdom",
"predeploy": "npm run build",
"deploy": "gh-pages -d build",
"eject": "react-scripts eject"
},
"browserslist": {
Expand Down
2 changes: 1 addition & 1 deletion src/components/CustomerList.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class CustomerList extends React.Component {
}

componentDidMount () {
axios.get('http://localhost:3000/customers')
axios.get('https://video-store-backend.herokuapp.com/customers')
.then((response) => {
this.setState({
customers: response.data,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Rental.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ class Rental extends React.Component {
due_date: dueDate.toISOString(),
}

axios.post(`http://localhost:3000/rentals/${movie.title}/check-out`, params)
axios.post(`https://video-store-backend.herokuapp.com/rentals/${movie.title}/check-out`, params)
.then((response) => {
this.setState({rental: response.data});
console.log(response.data);
Expand Down
2 changes: 1 addition & 1 deletion src/components/RentalLibrary.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RentalLibrary extends Component {
}

componentDidMount () {
axios.get('http://localhost:3000/movies')
axios.get('https://video-store-backend.herokuapp.com/movies')
.then((response) => {
this.setState({
movies: response.data
Expand Down
6 changes: 3 additions & 3 deletions src/components/RentalsList.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ class RentalsList extends React.Component {
}

componentDidMount () {
axios.get('http://localhost:3000/rentals')
axios.get('https://video-store-backend.herokuapp.com/rentals')
.then((response) => {
this.setState({
rentals: response.data,
Expand Down Expand Up @@ -65,7 +65,7 @@ class RentalsList extends React.Component {
}

getOverdueRentals() {
axios.get('http://localhost:3000/rentals/overdue')
axios.get('https://video-store-backend.herokuapp.com/rentals/overdue')
.then((response) => {
this.setState({
overdueRentals: response.data,
Expand All @@ -81,7 +81,7 @@ class RentalsList extends React.Component {
customer_id: customerId,
}

axios.post(`http://localhost:3000/rentals/${movieTitle}/return`, params)
axios.post(`https://video-store-backend.herokuapp.com/rentals/${movieTitle}/return`, params)
.then((response) => {
const newRentals = this.state.rentals.filter((rental) => rental.id !== rentalId);
this.setState({
Expand Down
4 changes: 2 additions & 2 deletions src/components/Search.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class SearchBar extends React.Component {

searchDatabase = (searchTerm) => {
this.resetNotification();
axios.get(`http://localhost:3000/movies?query=${searchTerm}`)
axios.get(`https://video-store-backend.herokuapp.com/movies?query=${searchTerm}`)
.then((response) => {
this.setState({
searchTerm: searchTerm,
Expand All @@ -46,7 +46,7 @@ addMovie = (movie) => {
external_id: movie.externalId
}

axios.post('http://localhost:3000/movies', params)
axios.post('https://video-store-backend.herokuapp.com/movies', params)
.then((response) => {
this.setState({
notification: true,
Expand Down

0 comments on commit 2b8f315

Please sign in to comment.