mirror of
https://github.com/docker/awesome-compose.git
synced 2025-04-28 23:31:47 +02:00
Frontend+Backend fixes
Signed-off-by: GitHub <noreply@github.com>
This commit is contained in:
parent
718df2a62d
commit
996b7ac9bf
10 changed files with 128 additions and 42 deletions
4
react-aspnet-mongodb/frontend/src/App.js
vendored
4
react-aspnet-mongodb/frontend/src/App.js
vendored
|
@ -15,10 +15,10 @@ export default class App extends React.Component {
|
|||
|
||||
componentDidMount() {
|
||||
axios
|
||||
.get("/api")
|
||||
.get("/api/todos")
|
||||
.then((response) => {
|
||||
this.setState({
|
||||
todos: response.data.data,
|
||||
todos: response.data,
|
||||
});
|
||||
})
|
||||
.catch((e) => console.log("Error : ", e));
|
||||
|
|
|
@ -37,8 +37,8 @@ export default class TodoList extends React.Component {
|
|||
}
|
||||
|
||||
render() {
|
||||
let { todos } = this.props;
|
||||
return todos.length > 0 ? (
|
||||
const { todos } = this.props;
|
||||
return (todos || []).length > 0 ? (
|
||||
this.renderTodos(todos)
|
||||
) : (
|
||||
<div className="alert alert-primary" role="alert">
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue