Git revert commit
parent
d188f8e590
commit
ea9ec9087b
|
@ -42,6 +42,7 @@ import { CreateClientComponent } from './components/groups/clients/create-client
|
|||
import { DeleteModalComponent } from './components/groups/delete-modal/delete-modal.component';
|
||||
import { EditOrganizationalUnitComponent } from './components/groups/organizational-units/edit-organizational-unit/edit-organizational-unit.component';
|
||||
import { EditClientComponent } from './components/groups/clients/edit-client/edit-client.component';
|
||||
import { ClassroomViewComponent } from './components/groups/classroom-view/classroom-view.component';
|
||||
|
||||
|
||||
@NgModule({ declarations: [
|
||||
|
@ -66,7 +67,8 @@ import { EditClientComponent } from './components/groups/clients/edit-client/edi
|
|||
CreateClientComponent,
|
||||
DeleteModalComponent,
|
||||
EditOrganizationalUnitComponent,
|
||||
EditClientComponent
|
||||
EditClientComponent,
|
||||
ClassroomViewComponent
|
||||
],
|
||||
bootstrap: [AppComponent],
|
||||
imports: [BrowserModule,
|
||||
|
|
|
@ -55,10 +55,10 @@ export class DataService {
|
|||
}
|
||||
|
||||
getClients(uuid: string): Observable<any[]> {
|
||||
console.log('unidadId', uuid);
|
||||
return this.http.get<any>(this.clientsUrl).pipe(
|
||||
map(response => {
|
||||
if (response['hydra:member'] && Array.isArray(response['hydra:member'])) {
|
||||
console.log(response);
|
||||
return response['hydra:member'].filter((client: any) => client.organizationalUnit && client.organizationalUnit['@id'] === `/organizational-units/${uuid}`);
|
||||
} else {
|
||||
throw new Error('Unexpected response format');
|
||||
|
|
|
@ -68,3 +68,7 @@
|
|||
</mat-card-content>
|
||||
</mat-card>
|
||||
</div>
|
||||
|
||||
|
||||
<app-classroom-view
|
||||
></app-classroom-view>
|
|
@ -1,6 +1,6 @@
|
|||
import { Component, OnInit } from '@angular/core';
|
||||
import { DataService } from './data.service';
|
||||
import { UnidadOrganizativa } from './model';
|
||||
import { ClientCollection, UnidadOrganizativa } from './model';
|
||||
import { MatDialog } from '@angular/material/dialog';
|
||||
import { CreateOrganizationalUnitComponent } from './organizational-units/create-organizational-unit/create-organizational-unit.component';
|
||||
import { DeleteModalComponent } from './delete-modal/delete-modal.component';
|
||||
|
@ -114,4 +114,6 @@ export class GroupsComponent implements OnInit {
|
|||
const dialogComponent = type === 'client' ? EditClientComponent : EditOrganizationalUnitComponent;
|
||||
this.dialog.open(dialogComponent as any); // Usando type assertion aquí
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -16,3 +16,38 @@ export interface UnidadOrganizativa {
|
|||
aulas: Aula[];
|
||||
}
|
||||
|
||||
export interface OrganizationalUnit {
|
||||
"@id": string;
|
||||
"@type": string;
|
||||
id: number;
|
||||
name: string;
|
||||
type: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface Client {
|
||||
"@id": string;
|
||||
"@type": string;
|
||||
id: number;
|
||||
name: string;
|
||||
type: string;
|
||||
serialNumber: string;
|
||||
netiface: string;
|
||||
organizationalUnit: OrganizationalUnit;
|
||||
partitions: any[];
|
||||
createdAt: string;
|
||||
createdBy: string;
|
||||
uuid: string;
|
||||
}
|
||||
|
||||
export interface ClientCollection {
|
||||
"@context": string;
|
||||
"@id": string;
|
||||
"@type": string;
|
||||
"hydra:totalItems": number;
|
||||
"hydra:member": Client[];
|
||||
"hydra:view": {
|
||||
"@id": string;
|
||||
"@type": string;
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue