사용자 정보 수정

This commit is contained in:
Park Byung Eun 2022-09-30 06:22:13 +00:00
parent 09ac08ce37
commit de8e3ddd1e
2 changed files with 13 additions and 7 deletions

View File

@ -164,7 +164,7 @@ export class HomeComponent implements OnInit {
*/
__onClickCompose(composeMenuType: ComposeMenuType): void {
let selectType: any;
let data = {};
if (
!this.loggedIn &&
composeMenuType !== ComposeMenuType.signIn &&
@ -188,6 +188,7 @@ export class HomeComponent implements OnInit {
break;
case ComposeMenuType.modifyMember:
selectType = ModifyMemberComposeComponent;
data = { member: this.member };
break;
case ComposeMenuType.deposit:
selectType = DepositComposeComponent;
@ -212,7 +213,7 @@ export class HomeComponent implements OnInit {
break;
}
const dialogRef = this._matDialog.open(selectType);
const dialogRef = this._matDialog.open(selectType, { data });
dialogRef.afterClosed().subscribe((result) => {
if (ComposeMenuType.signIn === composeMenuType && !!result.choice) {

View File

@ -1,4 +1,4 @@
import { Component, OnInit, ViewEncapsulation } from '@angular/core';
import { Component, Inject, OnInit, ViewEncapsulation } from '@angular/core';
import {
AbstractControl,
FormBuilder,
@ -6,7 +6,7 @@ import {
ValidatorFn,
Validators,
} from '@angular/forms';
import { MatDialogRef } from '@angular/material/dialog';
import { MatDialogRef, MAT_DIALOG_DATA } from '@angular/material/dialog';
import { fuseAnimations } from '@fuse/animations';
import { FuseAlertType } from '@fuse/components/alert';
import { BankService } from 'app/modules/polyglot/bank/services/bank.service';
@ -19,7 +19,11 @@ import {
UpdateMemberForPasswordRequest,
UpdateMemberForPasswordResponse,
} from 'app/modules/proto/c2se/member_pb';
import { MemberModel } from 'app/modules/proto/models/member_pb';
export interface ModifyMemberComposeData {
member: MemberModel;
}
export interface ModifyMemberComposeResult {}
@Component({
selector: 'modify-member-compose',
templateUrl: './modify-member-compose.component.html',
@ -44,6 +48,7 @@ export class ModifyMemberComposeComponent implements OnInit {
*/
constructor(
public matDialogRef: MatDialogRef<ModifyMemberComposeComponent>,
@Inject(MAT_DIALOG_DATA) public data: ModifyMemberComposeData,
private _formBuilder: FormBuilder,
private _identityService: IdentityService,
private _memberService: MemberService,
@ -60,8 +65,8 @@ export class ModifyMemberComposeComponent implements OnInit {
ngOnInit(): void {
// Create the form
this.modifyMemberComposeForm = this._formBuilder.group({
username: [{ value: '', disabled: true }],
nickname: [{ value: '', disabled: true }],
username: [{ value: this.data.member.getUsername(), disabled: true }],
nickname: [{ value: this.data.member.getNickname(), disabled: true }],
currentPassword: ['1234', [Validators.required]],
password: [
'1234',