add lista usuarios en ts
This commit is contained in:
parent
9ba02837b8
commit
d27b8a5c4b
|
@ -17,6 +17,7 @@ import { finalize } from 'rxjs/operators';
|
||||||
import * as Chartist from 'chartist';
|
import * as Chartist from 'chartist';
|
||||||
|
|
||||||
import { faWallet, faUsers, faUsersSlash } from '@fortawesome/free-solid-svg-icons';
|
import { faWallet, faUsers, faUsersSlash } from '@fortawesome/free-solid-svg-icons';
|
||||||
|
import { IUsuarioExtra } from '../../usuario-extra/usuario-extra.model';
|
||||||
|
|
||||||
@Component({
|
@Component({
|
||||||
selector: 'jhi-dashboard-admin',
|
selector: 'jhi-dashboard-admin',
|
||||||
|
@ -33,6 +34,7 @@ export class DashboardAdminComponent implements OnInit {
|
||||||
gananciasTotales: number = 0;
|
gananciasTotales: number = 0;
|
||||||
categorias: ICategoria[] | undefined = [];
|
categorias: ICategoria[] | undefined = [];
|
||||||
encuestas: IEncuesta[] | undefined = [];
|
encuestas: IEncuesta[] | undefined = [];
|
||||||
|
usuarios: IUsuarioExtra[] | null = [];
|
||||||
faWallet = faWallet;
|
faWallet = faWallet;
|
||||||
faUsers = faUsers;
|
faUsers = faUsers;
|
||||||
faUsersSlash = faUsersSlash;
|
faUsersSlash = faUsersSlash;
|
||||||
|
@ -77,6 +79,7 @@ export class DashboardAdminComponent implements OnInit {
|
||||||
cargarCantidadUsuarios() {
|
cargarCantidadUsuarios() {
|
||||||
this.usuarioExtraService.query().subscribe(res => {
|
this.usuarioExtraService.query().subscribe(res => {
|
||||||
const tmpUsuarios = res.body;
|
const tmpUsuarios = res.body;
|
||||||
|
this.usuarios = tmpUsuarios;
|
||||||
this.cantUsuarioActivos = tmpUsuarios?.filter(u => u.estado === 'ACTIVE').length;
|
this.cantUsuarioActivos = tmpUsuarios?.filter(u => u.estado === 'ACTIVE').length;
|
||||||
this.cantUsuarioBloqueados = tmpUsuarios?.filter(u => u.estado === 'SUSPENDED').length;
|
this.cantUsuarioBloqueados = tmpUsuarios?.filter(u => u.estado === 'SUSPENDED').length;
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue