2022-04-04 19:15:29 +00:00
|
|
|
import { TSubscriptionModel } from '../../definitions';
|
|
|
|
import database from '../database';
|
2022-02-10 12:10:42 +00:00
|
|
|
|
2022-04-28 20:37:25 +00:00
|
|
|
export async function getRoom(rid: string): Promise<TSubscriptionModel> {
|
2022-02-10 12:10:42 +00:00
|
|
|
try {
|
|
|
|
const db = database.active;
|
|
|
|
const room = await db.get('subscriptions').find(rid);
|
|
|
|
return Promise.resolve(room);
|
|
|
|
} catch (error) {
|
|
|
|
return Promise.reject(new Error('Room not found'));
|
|
|
|
}
|
|
|
|
}
|