- cd server
script:
- cargo build
- - cargo install diesel_cli --no-default-features --features postgres
- diesel migration run
- cargo test
env:
let user_details_id = match data.user_id {
Some(id) => id,
None => {
- User_::read_from_name(
+ match User_::read_from_name(
&conn,
data.username.to_owned().unwrap_or("admin".to_string()),
- )?
- .id
+ ) {
+ Ok(user) => user.id,
+ Err(_e) => return Err(APIError::err(&self.op, "couldnt_find_that_username_or_email"))?
+ }
}
};
if (msg.error) {
alert(i18n.t(msg.error));
this.state.deleteAccountLoading = false;
+ if (msg.error == 'couldnt_find_that_username_or_email') {
+ this.context.router.history.push('/');
+ }
this.setState(this.state);
return;
} else if (op == UserOperation.GetUserDetails) {