mirror of
https://gitlab.com/openstapps/openstapps.git
synced 2026-01-09 11:12:52 +00:00
32 lines
754 B
TypeScript
32 lines
754 B
TypeScript
import {Component} from '@angular/core';
|
|
import {LibraryAccountService} from '../library-account.service';
|
|
import {PAIAPatron} from '../../types';
|
|
|
|
@Component({
|
|
selector: 'app-profile',
|
|
templateUrl: './profile-page.component.html',
|
|
styleUrls: ['./profile-page.component.scss'],
|
|
})
|
|
export class ProfilePageComponent {
|
|
patron: PAIAPatron;
|
|
|
|
propertiesToShow: (keyof PAIAPatron)[] = [
|
|
'name',
|
|
'email',
|
|
'address',
|
|
'expires',
|
|
'note',
|
|
];
|
|
|
|
constructor(private readonly libraryAccountService: LibraryAccountService) {}
|
|
|
|
async ionViewWillEnter(): Promise<void> {
|
|
try {
|
|
this.patron = await this.libraryAccountService.getProfile();
|
|
console.log(this.patron);
|
|
} catch {
|
|
// TODO: error handling
|
|
}
|
|
}
|
|
}
|