Skip to content

Commit

Permalink
Chore: Migrate methods/getRooms to TS (#3702)
Browse files Browse the repository at this point in the history
* 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>
  • Loading branch information
gerzonc and diegolmello authored Feb 16, 2022
1 parent 7634297 commit ed71639
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
9 changes: 0 additions & 9 deletions app/lib/methods/getRooms.js

This file was deleted.

15 changes: 15 additions & 0 deletions app/lib/methods/getRooms.ts
Original file line number Diff line number Diff line change
@@ -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')]);
}

0 comments on commit ed71639

Please sign in to comment.