feat: add library account screens

This commit is contained in:
Jovan Krunić
2022-01-31 08:53:46 +00:00
parent 863a3ffd48
commit 080e6fa3e8
29 changed files with 770 additions and 1 deletions

View File

@@ -0,0 +1,31 @@
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
}
}
}