summaryrefslogtreecommitdiffstats
path: root/admin/WebConsole3/frontend/src/app/serializer/client.serializer.ts
blob: 3b893ada15686e124a5f9145a729d77b42d54a75 (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) ? client.hardwareProfile.id : null;
        // @ts-ignore
        client.netboot = (client.netboot && typeof client.netboot === 'object') ? client.netboot.id : client.netboot;
        return super.toJson(client);
    }
}