From 97f0a1a56a61c831615eee3717e84787ccafb5ce Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Tue, 23 Aug 2022 17:06:51 +0200 Subject: [PATCH] Align more request and reponse handlers name MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- .../ui-server/ui-services/AbstractUIService.ts | 4 ++-- src/ui/web/src/composable/UIClient.ts | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/charging-station/ui-server/ui-services/AbstractUIService.ts b/src/charging-station/ui-server/ui-services/AbstractUIService.ts index 30ad449a..805bda20 100644 --- a/src/charging-station/ui-server/ui-services/AbstractUIService.ts +++ b/src/charging-station/ui-server/ui-services/AbstractUIService.ts @@ -43,7 +43,7 @@ export default abstract class AbstractUIService { let requestPayload: RequestPayload; let responsePayload: ResponsePayload; try { - [messageId, command, requestPayload] = this.dataValidation(request); + [messageId, command, requestPayload] = this.requestValidation(request); if (this.requestHandlers.has(command) === false) { throw new BaseError( @@ -94,7 +94,7 @@ export default abstract class AbstractUIService { // Validate the raw data received from the WebSocket // TODO: should probably be moved to the ws verify clients callback - private dataValidation(rawData: RawData): ProtocolRequest { + private requestValidation(rawData: RawData): ProtocolRequest { // logger.debug( // `${this.uiServer.logPrefix( // moduleName, diff --git a/src/ui/web/src/composable/UIClient.ts b/src/ui/web/src/composable/UIClient.ts index ddaf32ed..eb8e013e 100644 --- a/src/ui/web/src/composable/UIClient.ts +++ b/src/ui/web/src/composable/UIClient.ts @@ -29,7 +29,7 @@ export default class UIClient { this._responseHandlers = new Map(); - this._ws.onmessage = this.handleResponse.bind(this); + this._ws.onmessage = this.responseHandler.bind(this); } public static get instance() { @@ -109,7 +109,7 @@ export default class UIClient { ); } - private handleResponse(messageEvent: MessageEvent): void { + private responseHandler(messageEvent: MessageEvent): void { const data = JSON.parse(messageEvent.data) as ProtocolResponse; if (Utils.isIterable(data) === false) { -- 2.34.1