|
|
|
@ -6,13 +6,9 @@ import {
|
|
|
|
|
OnChanges,
|
|
|
|
|
OnDestroy,
|
|
|
|
|
OnInit,
|
|
|
|
|
Output,
|
|
|
|
|
ViewChild
|
|
|
|
|
Output
|
|
|
|
|
} from '@angular/core';
|
|
|
|
|
import { MatDialog } from '@angular/material/dialog';
|
|
|
|
|
import { MatSort } from '@angular/material/sort';
|
|
|
|
|
import { MatTableDataSource } from '@angular/material/table';
|
|
|
|
|
import { ActivatedRoute, Router } from '@angular/router';
|
|
|
|
|
import { Account as AccountModel } from '@prisma/client';
|
|
|
|
|
import { Subject, Subscription } from 'rxjs';
|
|
|
|
|
|
|
|
|
@ -32,8 +28,6 @@ export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
@Output() accountDeleted = new EventEmitter<string>();
|
|
|
|
|
@Output() accountToUpdate = new EventEmitter<AccountModel>();
|
|
|
|
|
|
|
|
|
|
@ViewChild(MatSort) sort: MatSort;
|
|
|
|
|
|
|
|
|
|
public dataSource: MatTableDataSource<AccountModel> = new MatTableDataSource();
|
|
|
|
|
public displayedColumns = [];
|
|
|
|
|
public isLoading = true;
|
|
|
|
@ -41,11 +35,7 @@ export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
private unsubscribeSubject = new Subject<void>();
|
|
|
|
|
|
|
|
|
|
public constructor(
|
|
|
|
|
private dialog: MatDialog,
|
|
|
|
|
private route: ActivatedRoute,
|
|
|
|
|
private router: Router
|
|
|
|
|
) {}
|
|
|
|
|
public constructor() {}
|
|
|
|
|
|
|
|
|
|
public ngOnInit() {}
|
|
|
|
|
|
|
|
|
@ -60,7 +50,6 @@ export class AccountsTableComponent implements OnChanges, OnDestroy, OnInit {
|
|
|
|
|
|
|
|
|
|
if (this.accounts) {
|
|
|
|
|
this.dataSource = new MatTableDataSource(this.accounts);
|
|
|
|
|
this.dataSource.sort = this.sort;
|
|
|
|
|
|
|
|
|
|
this.isLoading = false;
|
|
|
|
|
}
|
|
|
|
|