From c199c427d4ae586339822320f20f512a7a19dc3f Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Thu, 18 Oct 2018 14:35:31 +0200 Subject: Better typings --- client/src/app/shared/rest/rest-extractor.service.ts | 4 ++-- client/src/app/shared/rest/rest.service.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'client/src/app/shared/rest') diff --git a/client/src/app/shared/rest/rest-extractor.service.ts b/client/src/app/shared/rest/rest-extractor.service.ts index 934f6c618..f149569ef 100644 --- a/client/src/app/shared/rest/rest-extractor.service.ts +++ b/client/src/app/shared/rest/rest-extractor.service.ts @@ -33,7 +33,7 @@ export class RestExtractor { return this.applyToResultListData(result, this.convertDateToHuman, [ fieldsToConvert ]) } - convertDateToHuman (target: any, fieldsToConvert: string[]) { + convertDateToHuman (target: { [ id: string ]: string }, fieldsToConvert: string[]) { fieldsToConvert.forEach(field => target[field] = dateToHuman(target[field])) return target @@ -83,7 +83,7 @@ export class RestExtractor { errorMessage = err } - const errorObj: any = { + const errorObj: { message: string, status: string, body: string } = { message: errorMessage, status: undefined, body: undefined diff --git a/client/src/app/shared/rest/rest.service.ts b/client/src/app/shared/rest/rest.service.ts index 41824a18f..e6d4e6e5e 100644 --- a/client/src/app/shared/rest/rest.service.ts +++ b/client/src/app/shared/rest/rest.service.ts @@ -32,7 +32,7 @@ export class RestService { return newParams } - addObjectParams (params: HttpParams, object: any) { + addObjectParams (params: HttpParams, object: { [ name: string ]: any }) { for (const name of Object.keys(object)) { const value = object[name] if (!value) continue -- cgit v1.2.3