diff --git a/src/packages/noauth/component/list/list.component.html b/src/packages/noauth/component/list/list.component.html index 9d276e8..3acb1a6 100644 --- a/src/packages/noauth/component/list/list.component.html +++ b/src/packages/noauth/component/list/list.component.html @@ -65,37 +65,11 @@ - - + + - - \ No newline at end of file + diff --git a/src/packages/noauth/component/list/list.component.ts b/src/packages/noauth/component/list/list.component.ts index 7f94a09..5d02c7e 100644 --- a/src/packages/noauth/component/list/list.component.ts +++ b/src/packages/noauth/component/list/list.component.ts @@ -44,7 +44,6 @@ class NoauthProbeResult { export class ListComponent implements OnInit, AfterContentInit { noAuthProbes$ = this.store.pipe(select(NoAuthProbeSelector.select('noAuthProbes'))); noauthProbes: NoauthProbeResult[]; - selected: NoAuthProbe = null; msgs: Message[]; @@ -93,7 +92,8 @@ export class ListComponent implements OnInit, AfterContentInit { } } - onAcceptOrDeny(isAccept: boolean) { + onAcceptOrDeny(isAccept: boolean, selected: NoAuthProbe) { + console.log(selected); this.msgs = []; const title = isAccept ? 'Are you sure to accept this Probe?' : 'Are you sure to deny this Probe'; @@ -105,39 +105,18 @@ export class ListComponent implements OnInit, AfterContentInit { message: message, icon: isAccept ? 'fa-check' : 'fa fa-trash', accept: () => { - isAccept ? this.handleAccept() : this.handleDeny(); - this.msgs.push({ severity: 'error', summary: 'Failed', detail: '연동 안했지롱' }); + isAccept ? this.handleAccept(selected) : this.handleDeny(selected); }, reject: () => { } }); } - handleAccept() { - this.store.dispatch(new ListStore.Accept(this.selected)); - this.noAuthProbes$.subscribe( - (noAuthProbes: NoAuthProbe[]) => { - if (noAuthProbes) { - this.msgs.push({ severity: 'success', summary: 'Success', detail: '개굿' }); - } - }, - (error: RPCClientError) => { - this.msgs.push({ severity: 'error', summary: 'Failed', detail: error.response.message }); - } - ); + handleAccept(selected) { + this.store.dispatch(new ListStore.Accept(selected)); } - handleDeny() { - this.store.dispatch(new ListStore.Deny(this.selected)); - this.noAuthProbes$.subscribe( - (noAuthProbes: NoAuthProbe[]) => { - if (noAuthProbes) { - this.msgs.push({ severity: 'success', summary: 'Success', detail: '개굿' }); - } - }, - (error: RPCClientError) => { - this.msgs.push({ severity: 'error', summary: 'Failed', detail: error.response.message }); - } - ); + handleDeny(selected) { + this.store.dispatch(new ListStore.Deny(selected)); } }