Merge branch 'signup-page' into restructure
This commit is contained in:
commit
332e4e94d8
@ -22,9 +22,15 @@ export default class Signup extends React.Component {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async registerUser() {
|
async registerUser() {
|
||||||
const registerResponse = await apiClient.post("/user", this.state);
|
const res = await apiClient.post("/user", this.state);
|
||||||
if (registerResponse.status === 200) {
|
if (res.status === 200) {
|
||||||
this.warnUser()
|
this.warnUser("You are successfully signed up!", "success")
|
||||||
|
} else if (res === 409) {
|
||||||
|
this.warnUser("This user already exists. Try logging in instead.", "danger")
|
||||||
|
} else if (res === 400) {
|
||||||
|
this.warnUser("Missing required fields.", "danger")
|
||||||
|
} else {
|
||||||
|
this.warnUser("Internal server error. Please try again later.", "danger")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user