Skip to content

Commit 46d824e

Browse files
Dan WahlinDan Wahlin
Dan Wahlin
authored and
Dan Wahlin
committed
Minor tweaks
1 parent dea682e commit 46d824e

File tree

3 files changed

+6
-7
lines changed

3 files changed

+6
-7
lines changed

src/public/app/core/data.service.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ export class DataService {
7373
.catch(this.handleError);
7474
}
7575

76-
updateCustomer(customer: ICustomer) : Observable<boolean> {
76+
updateCustomer(customer: ICustomer) : Observable<ICustomer> {
7777
return this.http.put(this.baseUrl + '/' + customer._id, customer, this.getRequestOptions())
7878
.map((res: Response) => {
7979
const data = res.json();

src/public/app/customers/customer-edit-reactive.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,8 +84,8 @@ export class CustomerEditReactiveComponent implements OnInit {
8484
if (value._id) {
8585

8686
this.dataService.updateCustomer(value)
87-
.subscribe((status: boolean) => {
88-
if (status) {
87+
.subscribe((customer: ICustomer) => {
88+
if (customer) {
8989
this.router.navigate(['/customers']);
9090
}
9191
else {

src/public/app/customers/customer-edit.component.ts

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,10 @@ export class CustomerEditComponent implements OnInit {
6464
if (this.customer._id) {
6565

6666
this.dataService.updateCustomer(this.customer)
67-
.subscribe((status: boolean) => {
68-
if (status) {
67+
.subscribe((customer: ICustomer) => {
68+
if (customer) {
6969
this.router.navigate(['/customers']);
70-
}
71-
else {
70+
} else {
7271
this.errorMessage = 'Unable to save customer';
7372
}
7473
},

0 commit comments

Comments
 (0)