From 09e429fc676c7dd370bba0495b072f81867bd250 Mon Sep 17 00:00:00 2001 From: Nicolai Ort Date: Tue, 19 Jan 2021 17:13:46 +0100 Subject: [PATCH] Added address to contact response ref #104 --- src/models/responses/ResponseGroupContact.ts | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/models/responses/ResponseGroupContact.ts b/src/models/responses/ResponseGroupContact.ts index f7e63b3..d7ac6f2 100644 --- a/src/models/responses/ResponseGroupContact.ts +++ b/src/models/responses/ResponseGroupContact.ts @@ -1,4 +1,5 @@ -import { IsInt, IsString } from "class-validator"; +import { IsInt, IsObject, IsString } from "class-validator"; +import { Address } from '../entities/Address'; import { GroupContact } from '../entities/GroupContact'; import { ResponseRunnerGroup } from './ResponseRunnerGroup'; @@ -45,9 +46,15 @@ export class ResponseGroupContact { /** * The contact's associated runner groups. */ + @IsObject() groups: ResponseRunnerGroup[]; - //TODO: Address + /** + * The contact's address. + * This is a address object to prevent any formatting differences. + */ + @IsObject() + address?: Address; /** * Creates a ResponseGroupContact object from a contact. @@ -60,6 +67,7 @@ export class ResponseGroupContact { this.lastname = contact.lastname; this.phone = contact.phone; this.email = contact.email; + this.address = contact.address; for (let group of contact.groups) { this.groups.push(group.toResponse()); }