diff options
Diffstat (limited to 'admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts')
-rw-r--r-- | admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts | 21 |
1 files changed, 16 insertions, 5 deletions
diff --git a/admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts b/admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts index f6004e6a..c2043805 100644 --- a/admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts +++ b/admin/WebConsole3/frontend/src/app/serializer/image.serializer.ts @@ -1,5 +1,16 @@ -import { Serializer } from "globunet-angular/core/providers/api/serializer";
-
-export class ImageSerializer extends Serializer {
-
-}
\ No newline at end of file +import { Serializer } from 'globunet-angular/core/providers/api/serializer'; +import {Image} from '../model/image'; + +export class ImageSerializer extends Serializer { + + toJson(resource: Image): any { + const image: any = Object.assign({}, resource); + if (image.client && image.client.id) { + image.client = image.client.id; + } + if (image.repository && image.repository.id) { + image.repository = image.repository.id; + } + return super.toJson(image); + } +} |