[FIX] Add method and id to method calls (#4444)

* add method and id to method calls

* 🧹
This commit is contained in:
Gleidson Daniel Silva 2022-08-17 14:45:50 -03:00 committed by GitHub
parent 28043a2eb5
commit 31a8c3e4fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 1 deletions

View File

@ -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 => {