bug fixed
This commit is contained in:
parent
3a560e2e0d
commit
453cb9dcbf
|
@ -47,12 +47,12 @@
|
|||
<mat-form-field>
|
||||
<mat-label>사이트명</mat-label>
|
||||
|
||||
<mat-select [formControlName]="'siteName'" placeholder="사이트 선택">
|
||||
<mat-select [formControlName]="'siteId'" placeholder="사이트 선택">
|
||||
<mat-option *ngFor="let site of sites" [value]="site.getId()">
|
||||
{{ site.getUrl() }}
|
||||
</mat-option>
|
||||
</mat-select>
|
||||
<mat-error *ngIf="composeForm.get('siteName')?.hasError('required')">
|
||||
<mat-error *ngIf="composeForm.get('siteId')?.hasError('required')">
|
||||
사이트명은 필수 입력입니다.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -62,14 +62,14 @@
|
|||
<mat-label>회원 아이디</mat-label>
|
||||
<input
|
||||
matInput
|
||||
[formControlName]="'signinId'"
|
||||
(focusout)="__checkSigninId($event)"
|
||||
[formControlName]="'username'"
|
||||
(focusout)="__checkUsernameDuplicate($event)"
|
||||
/>
|
||||
<mat-error *ngIf="composeForm.get('signinId')?.hasError('required')">
|
||||
<mat-error *ngIf="composeForm.get('username')?.hasError('required')">
|
||||
아이디는 필수 입력입니다.
|
||||
</mat-error>
|
||||
<mat-error
|
||||
*ngIf="composeForm.get('signinId')?.hasError('signinIdDuplicate')"
|
||||
*ngIf="composeForm.get('username')?.hasError('usernameDuplicate')"
|
||||
>
|
||||
아이디가 중복됩니다.
|
||||
</mat-error>
|
||||
|
@ -130,8 +130,10 @@
|
|||
|
||||
<mat-form-field>
|
||||
<mat-label>휴대폰번호</mat-label>
|
||||
<input matInput [formControlName]="'phoneNumber'" />
|
||||
<mat-error *ngIf="composeForm.get('phoneNumber')?.hasError('required')">
|
||||
<input matInput [formControlName]="'mobilePhoneNumber'" />
|
||||
<mat-error
|
||||
*ngIf="composeForm.get('mobilePhoneNumber')?.hasError('required')"
|
||||
>
|
||||
휴대폰번호는 필수 입력입니다.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -139,13 +141,13 @@
|
|||
<mat-form-field>
|
||||
<mat-label>은행명</mat-label>
|
||||
|
||||
<mat-select [formControlName]="'bankName'" placeholder="은행 선택">
|
||||
<mat-select [formControlName]="'bankId'" placeholder="은행 선택">
|
||||
<mat-option *ngFor="let bank of banks" [value]="bank.getId()">
|
||||
{{ bank.getName() }}
|
||||
</mat-option>
|
||||
<!-- <mat-option [value]="'0'"> 국민은행 </mat-option> -->
|
||||
</mat-select>
|
||||
<mat-error *ngIf="composeForm.get('bankName')?.hasError('required')">
|
||||
<mat-error *ngIf="composeForm.get('bankId')?.hasError('required')">
|
||||
은행명은 필수 입력입니다.
|
||||
</mat-error>
|
||||
</mat-form-field>
|
||||
|
@ -187,7 +189,7 @@
|
|||
>
|
||||
<div class="flex items-center mt-4 sm:mt-0">
|
||||
<!-- Save as draft -->
|
||||
<button class="sm:mx-3" mat-stroked-button (click)="saveAsDraft()">
|
||||
<button class="sm:mx-3" mat-stroked-button (click)="close()">
|
||||
<span>취소</span>
|
||||
</button>
|
||||
<!-- Send -->
|
||||
|
|
|
@ -73,14 +73,14 @@ export class RegistComposeComponent implements OnInit {
|
|||
// Create the form
|
||||
this.composeForm = this._formBuilder.group({
|
||||
partnerId: [{ value: this.data.parent.getUsername(), disabled: true }],
|
||||
siteName: ['', [Validators.required]],
|
||||
signinId: ['', [Validators.required]],
|
||||
siteId: ['', [Validators.required]],
|
||||
username: ['', [Validators.required]],
|
||||
password: ['beteran', [Validators.required]],
|
||||
exchangePw: ['', [Validators.required]],
|
||||
nickname: ['', [Validators.required]],
|
||||
calculateType: ['', [Validators.required]],
|
||||
phoneNumber: ['', [Validators.required]],
|
||||
bankName: ['', [Validators.required]],
|
||||
mobilePhoneNumber: ['', [Validators.required]],
|
||||
bankId: ['', [Validators.required]],
|
||||
accountNumber: ['', [Validators.required]],
|
||||
accountHolder: ['', [Validators.required]],
|
||||
});
|
||||
|
@ -139,35 +139,35 @@ export class RegistComposeComponent implements OnInit {
|
|||
|
||||
const {
|
||||
partnerId,
|
||||
siteName,
|
||||
signinId,
|
||||
siteId,
|
||||
username,
|
||||
password,
|
||||
exchangePassword,
|
||||
nickname,
|
||||
calculateType,
|
||||
phoneNumber,
|
||||
bankName,
|
||||
mobilePhoneNumber,
|
||||
bankId,
|
||||
accountNumber,
|
||||
accountHolder,
|
||||
} = this.composeForm.value;
|
||||
|
||||
let bank_account = new CreateMemberRequest.BankAccount();
|
||||
bank_account.setBankId(bankName);
|
||||
bank_account.setBankId(bankId);
|
||||
bank_account.setName(accountHolder);
|
||||
bank_account.setAccountNumber(accountNumber);
|
||||
|
||||
const member = new CreateMemberRequest();
|
||||
const site = new Site();
|
||||
site.setId(siteName);
|
||||
site.setId(siteId);
|
||||
|
||||
member.setSiteId(siteName);
|
||||
member.setUsername(signinId);
|
||||
member.setSiteId(siteId);
|
||||
member.setUsername(username);
|
||||
member.setPassword('beteran');
|
||||
member.setMemberClassId(this.data.classId);
|
||||
member.setMemberLevelId('c56231ac-2120-4a81-a30a-5d41fafb6c57');
|
||||
member.setReferrerMemberUsername(this.data.parent.getUsername());
|
||||
member.setNickname(nickname);
|
||||
member.setMobilePhoneNumber(phoneNumber);
|
||||
member.setMobilePhoneNumber(mobilePhoneNumber);
|
||||
member.setBankAccount(bank_account);
|
||||
|
||||
this._memberService
|
||||
|
@ -183,21 +183,21 @@ export class RegistComposeComponent implements OnInit {
|
|||
.finally(() => setTimeout(() => this.close(), 5000));
|
||||
}
|
||||
|
||||
private close(): void {
|
||||
close(): void {
|
||||
this.matDialogRef.close({
|
||||
choice: true,
|
||||
});
|
||||
}
|
||||
__checkSigninId(event: FocusEvent): void {
|
||||
const signinId = this.composeForm.get('signinId')?.value;
|
||||
// console.log(event, '::', signinId);
|
||||
__checkUsernameDuplicate(event: FocusEvent): void {
|
||||
const username = this.composeForm.get('username')?.value;
|
||||
// console.log(event, '::', username);
|
||||
this._identityService
|
||||
.checkUsernameForDuplication(signinId)
|
||||
.checkUsernameForDuplication(username)
|
||||
.then((isUse: boolean) => {
|
||||
if (!!isUse) {
|
||||
this.composeForm
|
||||
.get('signinId')
|
||||
?.setErrors({ signinIdDuplicate: true });
|
||||
.get('username')
|
||||
?.setErrors({ usernameDuplicate: true });
|
||||
}
|
||||
// this._changeDetectorRef.markForCheck();
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user