models.Project.findAll({ order: [["id", "DESC"]] }).then(function(projects) { var info = new Array(); info.message = "<br><ul>"; if (projects.length == 0) { info.message += " - <br>"; } else { for(var i=0; i<projects.length; i++){ info.message += "<li>" + projects[i].id + " | " + projects[i].name + "</li>"; } } info.message += "</ul>"; info.rows = projects; callback(null, info); }).catch(function(err) { callback(err, null); });
this.setState({'message': data.message});
break; case 401: this.setState({ message: data.message}); break; default:
<div>{versions.message}</div>
? "NO DB ENTRIES YET" : data.map(dat => ( <li style={{ padding: "10px" }} key={data.message}> <span style={{ color: "gray" }}> id: </span> {dat.id} <br /> <span style={{ color: "gray" }}> data: </span> {dat.message} </li> ))} style={{ width: "200px" }} /> <button onClick={() => this.putDataToDB(this.state.message)}> ADD </button>
? 'NO DB ENTRIES YET' : data.map((dat) => ( <span style={{ padding: '10px' }} key={data.message}> {dat.message} <span style={{ color: 'gray' }}> ({dat.id})</span>. </span> /> <button style={{ padding: '5px', width: '70px', color: 'black', backgroundColor: '#61dafb', borderColor: '#61dafb', marginLeft: '5px'}} onClick={() => this.addToDB(this.state.message)}> ADD </button>
break; case 401: this.setState({ message: data.message}); break; default:
break; case 401: this.setState({ message: data.message}); break; default:
? 'NO DB ENTRIES YET' : data.map((dat) => ( <li style={{ padding: '10px' }} key={data.message}> <span style={{ color: 'gray' }}> id: </span> {dat.id} <br /> <span style={{ color: 'gray' }}> data: </span> {dat.message} </li> ))} style={{ width: '200px' }} /> <button onClick={() => this.putDataToDB(this.state.message)}> ADD </button>
? "NO DB ENTRIES YET" : data.map(dat => ( <li style={{ padding: "10px" }} key={data.message}> <span style={{ color: "gray" }}> id: </span> {dat.id} <br /> <span style={{ color: "gray" }}> data: </span> {dat.message} </li> ))} style={{ width: "200px" }} /> <button onClick={() => this.putDataToDB(this.state.message)}> ADD </button>
? "NO DB ENTRIES YET" : data.map(dat => ( <li style={{ padding: "10px" }} key={data.message}> <span style={{ color: "gray" }}> id: </span> {dat.id} <br /> <span style={{ color: "gray" }}> data: </span> {dat.message} </li> ))} style={{ width: "200px" }} /> <button onClick={() => this.putDataToDB(this.state.message)}> ADD </button>