From: Jérôme Benoit Date: Tue, 23 Aug 2022 15:06:51 +0000 (+0200) Subject: Align more request and reponse handlers name X-Git-Tag: v1.1.66~22 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=97f0a1a56a61c831615eee3717e84787ccafb5ce;p=e-mobility-charging-stations-simulator.git Align more request and reponse handlers name Signed-off-by: Jérôme Benoit --- 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) {