35 lines
1002 B
TypeScript
35 lines
1002 B
TypeScript
import { Component, OnInit } from '@angular/core';
|
|
import { FamilyMember } from '../../entity/Member';
|
|
import { AuthService } from '../../services/auth.service';
|
|
import { FamilyMemberService } from '../../services/crudServices/family-member.service';
|
|
import { SessionService } from '../../services/session.service';
|
|
import { first } from "rxjs/operators";
|
|
@Component({
|
|
selector: 'ngx-user-profile',
|
|
templateUrl: './user-profile.component.html',
|
|
styleUrls: ['./user-profile.component.scss']
|
|
})
|
|
export class UserProfileComponent implements OnInit {
|
|
|
|
constructor(
|
|
private memberService: FamilyMemberService,
|
|
private authService: AuthService
|
|
) { }
|
|
data: FamilyMember;
|
|
processing: boolean;
|
|
ngOnInit(): void {
|
|
this.memberService.getById(this.authService.userAccess.memberId).pipe(first()).subscribe(result => {
|
|
this.data = result;
|
|
});
|
|
|
|
}
|
|
close() {
|
|
|
|
}
|
|
update() {
|
|
this.memberService.createOrUpdate(this.data).pipe(first()).subscribe(result => {
|
|
|
|
});
|
|
}
|
|
}
|