Browse Source

WIP - service hookup

new_auth
Dan 2 years ago
parent
commit
25a4be3bc5
  1. BIN
      packages/bridge-server/data/data.db
  2. 8
      packages/bridge-ui/src/app/components/new-season-dialog/new-season-dialog.component.ts
  3. 4
      packages/bridge-ui/src/app/services/seasons.service.ts

BIN
packages/bridge-server/data/data.db

Binary file not shown.

8
packages/bridge-ui/src/app/components/new-season-dialog/new-season-dialog.component.ts

@ -65,8 +65,12 @@ export class NewSeasonDialogComponent {
submit(): void {
let title = this.title.value != undefined ? this.title.value : "";
let subTitle = this.subTitle.value != undefined ? this.subTitle.value : "";
let startingDate = this.startingDate.value != undefined ? this.startingDate.value : new Date(Date.now());
let startingDate = this.startingDate.value != undefined ? this.startingDate.value : "";
//this.seasonsService.create();
let _date = new Date(startingDate);
this.seasonsService.create(title, subTitle, _date).subscribe(data => {
console.log(data);
});
}
}

4
packages/bridge-ui/src/app/services/seasons.service.ts

@ -31,4 +31,8 @@ export class SeasonsService {
});
return from(promise);
}
create(title: string, subTitle: string, startingDate: Date) {
return this.httpClient.post("http://localhost:3000/seasons/", {title, subTitle, startingDate});
}
}

Loading…
Cancel
Save