Chore: Migrate methods/getRooms to TS (#3702)
* migrate getRooms to TS * add sdk and set any types * Moved the new variable around and added ts-ignore to follow the pattern from /services/restApi.ts Co-authored-by: Diego Mello <diegolmello@gmail.com>
This commit is contained in:
parent
7634297439
commit
ed716396d0
|
@ -1,9 +0,0 @@
|
||||||
export default function (updatedSince) {
|
|
||||||
// subscriptions.get: Since RC 0.60.0
|
|
||||||
// rooms.get: Since RC 0.62.0
|
|
||||||
if (updatedSince) {
|
|
||||||
updatedSince = updatedSince.toISOString();
|
|
||||||
return Promise.all([this.sdk.get('subscriptions.get', { updatedSince }), this.sdk.get('rooms.get', { updatedSince })]);
|
|
||||||
}
|
|
||||||
return Promise.all([this.sdk.get('subscriptions.get'), this.sdk.get('rooms.get')]);
|
|
||||||
}
|
|
|
@ -0,0 +1,15 @@
|
||||||
|
import sdk from '../rocketchat/services/sdk';
|
||||||
|
|
||||||
|
export default function (updatedSince: Date) {
|
||||||
|
// subscriptions.get: Since RC 0.60.0
|
||||||
|
// rooms.get: Since RC 0.62.0
|
||||||
|
if (updatedSince) {
|
||||||
|
const updatedDate = updatedSince.toISOString();
|
||||||
|
// TODO: missing definitions from server
|
||||||
|
// @ts-ignore
|
||||||
|
return Promise.all([sdk.get('subscriptions.get', { updatedDate }), sdk.get('rooms.get', { updatedDate })]);
|
||||||
|
}
|
||||||
|
// TODO: missing definitions from server
|
||||||
|
// @ts-ignore
|
||||||
|
return Promise.all([sdk.get('subscriptions.get'), sdk.get('rooms.get')]);
|
||||||
|
}
|
Loading…
Reference in New Issue