diff --git a/src/app/modules/admin/member/user/components/view.component.ts b/src/app/modules/admin/member/user/components/view.component.ts index d09e34f..a196139 100644 --- a/src/app/modules/admin/member/user/components/view.component.ts +++ b/src/app/modules/admin/member/user/components/view.component.ts @@ -61,6 +61,7 @@ import { import { MemberBankAccountService } from 'app/modules/polyglot/member_bank_account/services/member_bank_account.service'; import { ListBanksResponse } from 'app/modules/proto/c2se/bank_pb'; import { ListMemberClassesResponse } from 'app/modules/proto/c2se/member_class_pb'; +import { ListSitesResponse } from 'app/modules/proto/c2se/site_pb'; @Component({ selector: 'user-view', @@ -291,39 +292,21 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { this._changeDetectorRef.markForCheck(); }); - this._siteService.listSites().then((result) => { - this.sites = result - .getSitesList() - .filter((v) => !!v.getShow() && !!v.getCanUse()); - this.memberDefaultForm - .get('siteUrl') - ?.setValue(this.currentMember?.getSite()?.getUrl()); - this._changeDetectorRef.markForCheck(); - }); - - /* this._bankService.listBanks().then((result) => { - this.memberBankForm.get('bankName')?.value; - - this.memberBankForm.patchValue({ - bankName: this.currentMember?.getBankAccount()?.getBank()?.getName(), - accountNumber: this.currentMember?.getBankAccount()?.getAccountNumber(), - accountHolder: this.currentMember?.getBankAccount()?.getName(), - description: this.currentMember?.getBankAccount()?.getMemo(), - }); - - this._changeDetectorRef.markForCheck(); - - this.banks = result.getBanksList(); - }); */ - this._activatedRoute.data.subscribe((data) => { let member: GetMemberResponse.Result = data['member']; this.currentMember = member.getMember(); - console.log(this.currentMember?.getState()); + let listMemberLevelsResult: ListMemberLevelsResponse.Result = + data['listMemberLevels']; + this.memberLevels = listMemberLevelsResult.getMemberLevelsList(); + + let listbanksResult: ListBanksResponse.Result = data['listMemberBanks']; + this.banks = listbanksResult.getBanksList(); + + let listSitesResult: ListSitesResponse.Result = data['listSites']; + this.sites = listSitesResult.getSitesList(); - /* console.log('dddd', listMemberResult.getMembersList()); */ this.memberDefaultForm.patchValue({ username: this.currentMember?.getUsername(), signinPw: '', @@ -332,18 +315,9 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { levelName: this.currentMember?.getMemberLevel()?.getName(), state: this.currentMember?.getState(), nickname: this.currentMember?.getNickname(), + siteUrl: this.currentMember?.getSite()?.getUrl(), }); - let listMemberLevelsResult: ListMemberLevelsResponse.Result = - data['listMemberLevels']; - this.memberLevels = listMemberLevelsResult.getMemberLevelsList(); - - let listMemberClassesResult: ListMemberClassesResponse.Result = - data['listMemberClasses']; - - let listbanksResult: ListBanksResponse.Result = data['listMemberBanks']; - this.banks = listbanksResult.getBanksList(); - this.memberBankForm.patchValue({ bankName: this.currentMember?.getBankAccount()?.getBank()?.getName(), accountNumber: this.currentMember?.getBankAccount()?.getAccountNumber(), diff --git a/src/app/modules/admin/member/user/user.routing.ts b/src/app/modules/admin/member/user/user.routing.ts index 70bb64f..28b9909 100644 --- a/src/app/modules/admin/member/user/user.routing.ts +++ b/src/app/modules/admin/member/user/user.routing.ts @@ -2,6 +2,7 @@ import { Route } from '@angular/router'; import { ListComponent } from 'app/modules/admin/member/user/components/list.component'; import { ViewComponent } from 'app/modules/admin/member/user/components/view.component'; +import { SiteResolver } from 'app/shared/resolvers/site.resolver'; import { ListMemberBanksResolver } from './resolvers/member-bank.resolver'; import { ListMemberClassesResolver } from './resolvers/member-class.resolver'; import { ListMemberLevelsResolver } from './resolvers/member-level.resolver'; @@ -16,7 +17,6 @@ export const userRoutes: Route[] = [ listmembers: ListMemberResolver, listMemberClasses: ListMemberClassesResolver, listMemberLevels: ListMemberLevelsResolver, - listMemberBanks: ListMemberBanksResolver, }, }, { @@ -25,6 +25,8 @@ export const userRoutes: Route[] = [ resolve: { member: MemberResolver, listMemberLevels: ListMemberLevelsResolver, + listMemberBanks: ListMemberBanksResolver, + listSites: SiteResolver, }, }, ]; diff --git a/src/app/modules/admin/settings/domain/domain.routing.ts b/src/app/modules/admin/settings/domain/domain.routing.ts index 4b6ecd0..bba52f7 100644 --- a/src/app/modules/admin/settings/domain/domain.routing.ts +++ b/src/app/modules/admin/settings/domain/domain.routing.ts @@ -1,9 +1,8 @@ import { Route } from '@angular/router'; +import { SiteResolver } from 'app/shared/resolvers/site.resolver'; import { ListComponent } from './components/list.component'; -import { SiteResolver } from './resolvers/site.resolver'; - export const domainRoutes: Route[] = [ { path: '', diff --git a/src/app/modules/admin/settings/domain/resolvers/site.resolver.ts b/src/app/shared/resolvers/site.resolver.ts similarity index 100% rename from src/app/modules/admin/settings/domain/resolvers/site.resolver.ts rename to src/app/shared/resolvers/site.resolver.ts