diff --git a/barker/views/guest_book.py b/barker/views/guest_book.py index 3331c46..f88ebd8 100644 --- a/barker/views/guest_book.py +++ b/barker/views/guest_book.py @@ -12,7 +12,7 @@ def save(request): json = request.json_body company = json['company'].strip() if json['company'] is not None else '' name = json['name'].strip() - phone = str(json['phone']) + phone = json['phone'] address = json['address'].strip() customer = request.dbsession.query(Customer).filter(Customer.phone == phone).first() if customer is None: diff --git a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts index 16bdec8..ec20ff0 100644 --- a/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts +++ b/bookie/src/app/guest-book/guest-book-detail/guest-book-detail.component.ts @@ -50,11 +50,13 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit { showItem(item: GuestBook) { this.item = item; - this.form.get('company').setValue(item.company); - this.form.get('name').setValue(item.name); - this.form.get('phone').setValue(item.phone); - this.form.get('pax').setValue('' + item.pax); - this.form.get('address').setValue(item.address); + this.form.setValue({ + company: item.company, + name: item.name, + phone: item.phone, + pax: '' + item.pax, + address: item.address + }); } save() { diff --git a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts index de13bcf..1b43a88 100644 --- a/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts +++ b/bookie/src/app/guest-book/guest-book-list/guest-book-list.component.ts @@ -38,7 +38,6 @@ export class GuestBookListComponent implements OnInit { ).subscribe(x => { return this.ser.list(x) .subscribe((list: GuestBookList) => { - console.log("date changed"); this.data.next(list.list); }); });