Guest book
This commit is contained in:
parent
7b08fe611f
commit
87076d9c00
@ -12,7 +12,7 @@ def save(request):
|
|||||||
json = request.json_body
|
json = request.json_body
|
||||||
company = json['company'].strip() if json['company'] is not None else ''
|
company = json['company'].strip() if json['company'] is not None else ''
|
||||||
name = json['name'].strip()
|
name = json['name'].strip()
|
||||||
phone = str(json['phone'])
|
phone = json['phone']
|
||||||
address = json['address'].strip()
|
address = json['address'].strip()
|
||||||
customer = request.dbsession.query(Customer).filter(Customer.phone == phone).first()
|
customer = request.dbsession.query(Customer).filter(Customer.phone == phone).first()
|
||||||
if customer is None:
|
if customer is None:
|
||||||
|
@ -50,11 +50,13 @@ export class GuestBookDetailComponent implements OnInit, AfterViewInit {
|
|||||||
|
|
||||||
showItem(item: GuestBook) {
|
showItem(item: GuestBook) {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
this.form.get('company').setValue(item.company);
|
this.form.setValue({
|
||||||
this.form.get('name').setValue(item.name);
|
company: item.company,
|
||||||
this.form.get('phone').setValue(item.phone);
|
name: item.name,
|
||||||
this.form.get('pax').setValue('' + item.pax);
|
phone: item.phone,
|
||||||
this.form.get('address').setValue(item.address);
|
pax: '' + item.pax,
|
||||||
|
address: item.address
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
save() {
|
save() {
|
||||||
|
@ -38,7 +38,6 @@ export class GuestBookListComponent implements OnInit {
|
|||||||
).subscribe(x => {
|
).subscribe(x => {
|
||||||
return this.ser.list(x)
|
return this.ser.list(x)
|
||||||
.subscribe((list: GuestBookList) => {
|
.subscribe((list: GuestBookList) => {
|
||||||
console.log("date changed");
|
|
||||||
this.data.next(list.list);
|
this.data.next(list.list);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
x
Reference in New Issue
Block a user