don't allow createProject with empty name

This commit is contained in:
notnull 2019-06-26 07:42:30 -04:00
parent 13bade9e81
commit 278be8c120

View File

@ -3,6 +3,10 @@ const API = process.env.REACT_APP_API || 'http://localhost:1337'
export async function createProject(e) {
e.preventDefault()
if (this.state.newProject === '') {
alert('What about a project name?')
return
}
const project = { name: this.state.newProject }
try {
const { data, error } = await axios.post(API + '/api/projects', project)