Fix:
Update password works Updated the precision and nullability for models Batch was sending non round quantity_available Amounts were not being displayed in daybook Moved dockerfile from root to have a consistent build environment
This commit is contained in:
@ -7,7 +7,7 @@ import * as moment from 'moment';
|
||||
import { Observable, of as observableOf } from 'rxjs';
|
||||
import { debounceTime, distinctUntilChanged, map, startWith, switchMap } from 'rxjs/operators';
|
||||
|
||||
import {environment} from "../../environments/environment";
|
||||
import { environment } from '../../environments/environment';
|
||||
import { AuthService } from '../auth/auth.service';
|
||||
import { Product } from '../core/product';
|
||||
import { ToasterService } from '../core/toaster.service';
|
||||
|
||||
@ -70,15 +70,27 @@ export class UserDetailComponent implements OnInit, AfterViewInit {
|
||||
}
|
||||
|
||||
save() {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/users');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
if (this.route.snapshot.paramMap.get('id') === 'me') {
|
||||
this.ser.updateMe(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
} else {
|
||||
this.ser.saveOrUpdate(this.getItem()).subscribe(
|
||||
() => {
|
||||
this.toaster.show('Success', '');
|
||||
this.router.navigateByUrl('/users');
|
||||
},
|
||||
(error) => {
|
||||
this.toaster.show('Danger', error);
|
||||
},
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
delete() {
|
||||
|
||||
@ -59,6 +59,14 @@ export class UserService {
|
||||
);
|
||||
}
|
||||
|
||||
updateMe(user: User): Observable<User> {
|
||||
return <Observable<User>>(
|
||||
this.http
|
||||
.put<User>(`${url}/me`, user, httpOptions)
|
||||
.pipe(catchError(this.log.handleError(serviceName, 'update')))
|
||||
);
|
||||
}
|
||||
|
||||
saveOrUpdate(user: User): Observable<User> {
|
||||
if (!user.id) {
|
||||
return this.save(user);
|
||||
|
||||
Reference in New Issue
Block a user