Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ports - Kasey + Mina #20

Open
wants to merge 25 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
31a2286
uhhh
kaseea Jun 25, 2019
fd0ceaf
some templetey stuff
kaseea Jun 25, 2019
0f4b6b8
hopefully points the right direction
kaseea Jun 25, 2019
32ae56f
restructure axios get higher up to access state, and brings selected …
kaseea Jun 26, 2019
282fe1a
displays (poorly) the selected customer and movie, although, no way t…
kaseea Jun 26, 2019
5290524
testing search component
minams Jun 26, 2019
2d559c2
added query
minams Jun 26, 2019
542c53d
added search functionality
minams Jun 26, 2019
b6e1c42
Merge pull request #1 from kaseea/search
minams Jun 26, 2019
9ea7977
renders movies
minams Jun 26, 2019
41d0dd2
Merge pull request #2 from kaseea/search
minams Jun 26, 2019
30651df
changed url to reflect internal db
minams Jun 26, 2019
d4bc6fa
Merge pull request #3 from kaseea/search
minams Jun 26, 2019
57f47ab
fixing post
minams Jun 26, 2019
f463de6
adds all required funcionality minus search
kaseea Jun 26, 2019
931c306
able to post to database
minams Jun 27, 2019
695824c
some stuff
kaseea Jun 27, 2019
5184dc1
Merge branch 'master' of https://github.com/kaseea/video-store-consumer
kaseea Jun 27, 2019
4c11769
added custom message for posting duplicate movies
minams Jun 27, 2019
e052cc0
some stuff
kaseea Jun 28, 2019
12b2fe5
we merged stuff
kaseea Jun 28, 2019
9f5703e
library component renders when movie is added
minams Jun 28, 2019
d5654e5
add logic to not display anything after 2000
kaseea Jun 28, 2019
9a8ae19
some flexing
kaseea Jun 28, 2019
184e799
more css
kaseea Jun 28, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
hopefully points the right direction
kaseea committed Jun 25, 2019
commit 0f4b6b831e969f9e169f20817c2ee4444c9e173a
2 changes: 1 addition & 1 deletion src/components/Customer.js
Original file line number Diff line number Diff line change
@@ -22,7 +22,7 @@ class Customer extends Component {
return (
<div>
{ console.log(this.props.customer) }
<h2>THIS IS A CUSTOMER</h2>
<p>{this.props.customer.name}</p>
</div>
)
}
24 changes: 18 additions & 6 deletions src/components/CustomerCollection.js
Original file line number Diff line number Diff line change
@@ -40,15 +40,27 @@ componentDidMount() {


render() {
// const customerComponents = this.state.customers.map((movieObject, i) => {
const customerComponents = this.state.customers.map((customer, i) => {
console.log(customer)
return (
<div>
<p>ugggh</p>
{/* // <div key={i}> */}
{/* <Customer customer={movieObject}/> */}
<div key={i}>
{/* { console.log(customer)} */}

<Customer customer={customer}/>
</div>
)
// });
});

return (
<section>
<p>{this.state.message}</p>


<ul>
{customerComponents}
</ul>
</section>
);
}
}

68 changes: 61 additions & 7 deletions src/components/Library.js
Original file line number Diff line number Diff line change
@@ -1,21 +1,75 @@
import React, { Component } from 'react';
import PropTypes from 'prop-types';
import axios from 'axios';


class Library extends Component {

constructor(props) {
super(props);

this.state = {
movies: [],
};
}


render() {
return (
<div>
{ console.log(this.props.customer) }
<h2>THIS IS A MOVIE</h2>
</div>
)
componentDidMount() {
// const localUrl = this.props.url + this.props.boardName + "/cards"
const localUrl = 'http://localhost:3007/movies'
console.log(localUrl);
// is this needed and why?
// const cards = this.state.cards
axios.get(localUrl)
.then((response) => {
console.log("in axios!");
console.log(response.data)
this.setState({

movies: response.data,
})
})
.catch((error) => {
this.setState({ errorMessage: error.message });
});
}




render() {
const movieComponents = this.state.movies.map((movie, i) => {
console.log(movie)
return (
<div key={i}>
<p>{movie.title}</p>
</div>
)
});

return (
<section>
<p>{this.state.message}</p>


<ul>
{movieComponents}
</ul>
</section>
);
}
}

// render() {
// return (
// <div>
// { console.log(this.props.customer) }
// <h2>THIS IS A MOVIE</h2>
// </div>
// )
// }
// }

Library.propTypes = {

};