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 f45c37c..0442cf8 100644 --- a/src/app/modules/admin/member/user/components/view.component.ts +++ b/src/app/modules/admin/member/user/components/view.component.ts @@ -361,24 +361,6 @@ export class ViewComponent implements OnInit, AfterViewInit, OnDestroy { canBetSlot: memberGameSetting?.getCanBetSlot(), }); - const firstParent = this.currentMember?.getParentMember(); - if (!!firstParent) { - const secondParent = this.listMembers.find( - (v) => v.getId() === firstParent?.getParentMemberId() - ); - if (!!secondParent) { - const thirdParent = this.listMembers.find( - (v) => v.getId() === secondParent?.getParentMember()?.getId() - ); - - if (!!thirdParent) { - const fourParent = this.listMembers.find( - (v) => v.getId() === thirdParent?.getParentMember()?.getId() - ); - } - } - } - this.getParentMembers(this.currentMember); console.log(this.parentMembers); diff --git a/src/app/modules/admin/member/user/user.routing.ts b/src/app/modules/admin/member/user/user.routing.ts index c986218..64e94b8 100644 --- a/src/app/modules/admin/member/user/user.routing.ts +++ b/src/app/modules/admin/member/user/user.routing.ts @@ -3,6 +3,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 { + ListAllMemberResolver, ListMemberResolver, MemberResolver, } from 'app/shared/resolvers/member.resolver'; @@ -28,7 +29,7 @@ export const userRoutes: Route[] = [ component: ViewComponent, resolve: { member: MemberResolver, - listmembers: ListMemberResolver, + listmembers: ListAllMemberResolver, listMemberLevels: ListMemberLevelsResolver, listMemberBanks: ListMemberBanksResolver, listSites: SiteResolver, diff --git a/src/app/shared/resolvers/member.resolver.ts b/src/app/shared/resolvers/member.resolver.ts index 6bea2f8..aba3b9c 100644 --- a/src/app/shared/resolvers/member.resolver.ts +++ b/src/app/shared/resolvers/member.resolver.ts @@ -14,6 +14,37 @@ import { GetMemberResponse } from 'app/modules/proto/c2se/member_pb'; import { Observable } from 'rxjs'; +@Injectable({ + providedIn: 'root', +}) +export class ListAllMemberResolver implements Resolve { + /** + * Constructor + */ + constructor(private _router: Router, private _memberService: MemberService) {} + + // ----------------------------------------------------------------------------------------------------- + // @ Public methods + // ----------------------------------------------------------------------------------------------------- + + /** + * Resolver + * + * @param route + * @param state + */ + + resolve( + route: ActivatedRouteSnapshot, + state: RouterStateSnapshot + ): + | Observable + | Promise + | ListMembersResponse.Result { + let req = new ListMembersRequest(); + return this._memberService.listMembers(req); + } +} @Injectable({ providedIn: 'root', })