diff --git a/src/app/view/admin/components/common-table/common-table.component.ts b/src/app/view/admin/components/common-table/common-table.component.ts index cf7ec26..7f9d56c 100644 --- a/src/app/view/admin/components/common-table/common-table.component.ts +++ b/src/app/view/admin/components/common-table/common-table.component.ts @@ -54,7 +54,7 @@ export class CommonTableComponent implements OnInit, OnChanges { count: countValue } this.pageInfo.emit({page: pageValue, pageSize: countValue}) - this.httpService.Service>(this.request).subscribe({ + return this.httpService.Service>(this.request).subscribe({ next: resp => { this.dataList = resp.result; this.loading = false; @@ -64,6 +64,12 @@ export class CommonTableComponent implements OnInit, OnChanges { } ngOnChanges(changes: SimpleChanges): void { + if (changes.request && !changes.request.isFirstChange()) { + console.log(changes.request) + this.request = changes.request.currentValue; + this.getData().unsubscribe(); + this.getData(); + } }