verdnatura-chat/app/lib/methods/getRooms.ts

20 lines
586 B
TypeScript
Raw Normal View History

2022-04-28 18:45:00 +00:00
import sdk from '../services/sdk';
2022-02-28 18:00:47 +00:00
2022-05-30 22:02:08 +00:00
export function getRooms(updatedSince: Date) {
2022-02-28 18:00:47 +00:00
// 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
return Promise.all([
// @ts-ignore
sdk.get('subscriptions.get', { updatedSince: updatedDate }),
// @ts-ignore
sdk.get('rooms.get', { updatedSince: updatedDate })
]);
}
// TODO: missing definitions from server
// @ts-ignore
return Promise.all([sdk.get('subscriptions.get'), sdk.get('rooms.get')]);
}