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:
Gerzon Z 2022-02-16 10:48:15 -04:00 committed by GitHub
parent 7634297439
commit ed716396d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 15 additions and 9 deletions

View File

@ -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')]);
}

View File

@ -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')]);
}