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:
2020-11-03 21:50:30 +05:30
parent 0ab81b25d0
commit ba4f8a4831
16 changed files with 435 additions and 188 deletions

View File

@ -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';

View File

@ -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() {

View File

@ -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);