- Timestamp:
- Apr 22, 2019, 5:39:46 PM (8 years ago)
- Branches:
- debian/bullseye, master
- Children:
- 041e464
- Parents:
- 5e4cb73
- File:
-
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
src/mapservice-webclient/src/app/mygnuboat/user.component.ts
r5e4cb73 rbe25db1 3 3 import { first } from 'rxjs/operators'; 4 4 5 import { User, UsersService } from '../../../src-gen/gnuboat-mapservice';5 import { User, UsersService, Water, WatersService } from '../../../src-gen/gnuboat-mapservice'; 6 6 import { AuthenticationService } from '../services'; 7 7 … … 11 11 currentUserSubscription: Subscription; 12 12 apiKeys: string[] = []; 13 waters: Water[] = []; 13 14 14 15 constructor( 15 16 private authenticationService: AuthenticationService, 16 private usersService: UsersService 17 private usersService: UsersService, 18 private watersService: WatersService 17 19 ) { 18 20 this.currentUserSubscription = this.authenticationService.currentUser.subscribe(user => { … … 20 22 this.usersService.configuration.username = user.username; 21 23 this.usersService.configuration.password = this.authenticationService.currentUserPassword; 24 // this.watersService.configuration = user.username; 25 // this.watersService.configuration.password = this.authenticationService.currentUserPassword; 26 this.watersService.watersGet(undefined, user.username).pipe(first()).subscribe(waters => { 27 this.waters = waters 28 }); 22 29 }); 23 30 } … … 25 32 ngOnInit() { 26 33 this.apiKeys = this.currentUser.apiKeys; 27 console.log([this.currentUser, this.currentUser.apiKeys, this.apiKeys]);28 34 } 29 35 … … 33 39 } 34 40 35 deleteApiKey(apiKey: string) {41 apiKeyDelete(apiKey: string) { 36 42 this.usersService.usersApiKeyDelete(apiKey).pipe(first()).subscribe(keys => { 37 43 this.apiKeys = keys 38 44 }); 39 45 } 46 47 apiKeyCreate(){ 48 this.usersService.usersApiKeyCreate().pipe(first()).subscribe(keys => { 49 this.apiKeys = keys 50 }); 51 } 40 52 }
Note:
See TracChangeset
for help on using the changeset viewer.
