summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole3/frontend/src/app/serializer/client.serializer.ts
blob: efce43808d7b0c55b82298a1d91e2d913aeea73b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
import { Serializer } from 'globunet-angular/core/providers/api/serializer';
import {Client} from '../model/client';

export class ClientSerializer extends Serializer {

    toJson(client: Client): any {
        // @ts-ignore
        client.repository = (client.repository && typeof client.repository === 'object') ? client.repository.id : client.repository;
        // @ts-ignore
        client.hardwareProfile =  (client.hardwareProfile && typeof client.hardwareProfile === 'object') ? client.hardwareProfile.id : client.hardwareProfile;
        // @ts-ignore
        client.netboot = (client.netboot && typeof client.netboot === 'object') ? client.netboot.id : client.netboot;
        return super.toJson(client);
    }
}