[FIX] Method calls not sending date params as EJSON (#3159)
This commit is contained in:
parent
3ef4ef5317
commit
6d3bcfbd67
|
@ -945,7 +945,13 @@ const RocketChat = {
|
||||||
if (API_Use_REST_For_DDP_Calls) {
|
if (API_Use_REST_For_DDP_Calls) {
|
||||||
return this.post(`method.call/${ method }`, { message: EJSON.stringify({ method, params }) });
|
return this.post(`method.call/${ method }`, { message: EJSON.stringify({ method, params }) });
|
||||||
}
|
}
|
||||||
return this.methodCall(method, ...params);
|
const parsedParams = params.map((param) => {
|
||||||
|
if (param instanceof Date) {
|
||||||
|
return { $date: new Date(param).getTime() };
|
||||||
|
}
|
||||||
|
return param;
|
||||||
|
});
|
||||||
|
return this.methodCall(method, ...parsedParams);
|
||||||
},
|
},
|
||||||
|
|
||||||
getUserRoles() {
|
getUserRoles() {
|
||||||
|
|
Loading…
Reference in New Issue