diff --git a/src/app/modules/admin/member/partner-recommendation/components/list.component.ts b/src/app/modules/admin/member/partner-recommendation/components/list.component.ts index 6672632..45d99d9 100644 --- a/src/app/modules/admin/member/partner-recommendation/components/list.component.ts +++ b/src/app/modules/admin/member/partner-recommendation/components/list.component.ts @@ -41,8 +41,13 @@ import { MatTableDataSource } from '@angular/material/table'; import { MemberModel } from 'app/modules/proto/models/member_pb'; import { ListMembersResponse } from 'app/modules/proto/c2se/member_pb'; import { SelectionModel } from '@angular/cdk/collections'; -import { AddComposeComponent } from '../compose/add-compose.component'; +import { + AddComposeComponent, + AddComposeResult, +} from '../compose/add-compose.component'; import { DeleteComposeComponent } from '../compose/delete-compose.component'; +import { MemberService } from 'app/modules/polyglot/member/services/member.service'; +import { MemberReferrerService } from 'app/modules/polyglot/member_referrer/services/member_referrer.service'; @Component({ selector: 'partner-recommendation-list', templateUrl: './list.component.html', @@ -130,7 +135,9 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { private _formBuilder: FormBuilder, private _partnerRecommendationService: PartnerRecommendationService, private router: Router, - private _matDialog: MatDialog + private _matDialog: MatDialog, + private _memberService: MemberService, + private _memberReffererService: MemberReferrerService ) {} // ----------------------------------------------------------------------------------------------------- @@ -329,8 +336,15 @@ export class ListComponent implements OnInit, AfterViewInit, OnDestroy { __onClickAdd(event: MouseEvent): void { const dialogRef = this._matDialog.open(AddComposeComponent); - dialogRef.afterClosed().subscribe((result) => { + dialogRef.afterClosed().subscribe((result: AddComposeResult) => { console.log('Compose dialog was closed!'); + if (!!result.choice) { + if (!!this.registSelection.hasValue()) { + this.registSelection.selected.forEach((m: MemberModel) => { + this._memberReffererService.createMemberReferrer(m.getId()); + }); + } + } }); } __onClickDelete(event: MouseEvent): void { diff --git a/src/app/modules/admin/member/partner-recommendation/compose/add-compose.component.html b/src/app/modules/admin/member/partner-recommendation/compose/add-compose.component.html index 8f0872a..8b596bd 100644 --- a/src/app/modules/admin/member/partner-recommendation/compose/add-compose.component.html +++ b/src/app/modules/admin/member/partner-recommendation/compose/add-compose.component.html @@ -4,7 +4,7 @@ class="flex flex-0 items-center justify-between h-16 pr-3 sm:pr-5 pl-6 sm:pl-8 bg-primary text-on-primary" >