fixed new user model input and renaming model group

This commit is contained in:
VLE2FE
2020-09-01 13:55:13 +02:00
parent 8fd993b362
commit ea02ba0f09
6 changed files with 26 additions and 10 deletions

View File

@ -41,7 +41,9 @@ export class UsersComponent implements OnInit {
}
saveUser(user: UserModel) {
console.log(user.models);
user.models = user.models.filter(e => e !== '');
console.log(user.models);
this.api.put<UserModel>('/user/' + user.origName, user.sendFormat('admin'), data => {
user.deserialize(data);
user.edit = false;
@ -49,6 +51,7 @@ export class UsersComponent implements OnInit {
}
saveNewUser() {
// this.newUser.models = this.newUser.models.filter(e => e !== '' || e !== undefined);
this.api.post('/user/new', {...this.newUser.sendFormat('admin'), pass: this.newUserPass}, data => {
this.newUser = null;
this.users.push(new UserModel().deserialize(data));