1
0
Fork 0
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:
Esteban Solano Granados 2022-06-13 17:28:56 +00:00 committed by GitHub
parent 718df2a62d
commit 996b7ac9bf
10 changed files with 128 additions and 42 deletions

View file

@ -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));

View file

@ -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">