From 31a8c3e4fbea84bb34ca1b596977e7d12c968586 Mon Sep 17 00:00:00 2001 From: Gleidson Daniel Silva Date: Wed, 17 Aug 2022 14:45:50 -0300 Subject: [PATCH] [FIX] Add method and id to method calls (#4444) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * add method and id to method calls * 🧹 --- app/lib/services/sdk.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/lib/services/sdk.ts b/app/lib/services/sdk.ts index 05099c52..3f1e4796 100644 --- a/app/lib/services/sdk.ts +++ b/app/lib/services/sdk.ts @@ -6,6 +6,7 @@ import { twoFactor } from './twoFactor'; import { isSsl } from '../methods/helpers/url'; import { store as reduxStore } from '../store/auxStore'; import { Serialized, MatchPathPattern, OperationParams, PathFor, ResultFor } from '../../definitions/rest/helpers'; +import { random } from '../methods/helpers'; class Sdk { private sdk: typeof Rocketchat; @@ -140,7 +141,7 @@ class Sdk { const url = isEmpty(user) ? 'method.callAnon' : 'method.call'; // @ts-ignore return this.post(`${url}/${method}`, { - message: EJSON.stringify({ method, params }) + message: EJSON.stringify({ msg: 'method', id: random(10), method, params }) }); } const parsedParams = params.map(param => {