@@ -28,6 +28,7 @@ import {
2828} from '@rocket.chat/rest-typings' ;
2929import { isPOSTLivechatVisitorDepartmentTransferParams } from '@rocket.chat/rest-typings/src/v1/omnichannel' ;
3030import { check } from 'meteor/check' ;
31+ import { Meteor } from 'meteor/meteor' ;
3132
3233import { callbacks } from '../../../../../server/lib/callbacks' ;
3334import { i18n } from '../../../../../server/lib/i18n' ;
@@ -67,7 +68,7 @@ API.v1.addRoute(
6768 agentId : Match . Maybe ( String ) ,
6869 } ) ;
6970
70- check ( this . queryParams , extraCheckParams as any ) ;
71+ check ( this . queryParams , extraCheckParams ) ;
7172
7273 const { token, rid, agentId, ...extraParams } = this . queryParams ;
7374
@@ -291,7 +292,7 @@ API.v1.addRoute(
291292 } ;
292293
293294 const room = await LivechatRooms . findOneById ( this . bodyParams . roomId ) ;
294- if ( ! room || room . t !== 'l' ) {
295+ if ( room ? .t !== 'l' ) {
295296 throw new Error ( 'error-invalid-room' ) ;
296297 }
297298
@@ -358,7 +359,7 @@ const livechatVisitorDepartmentTransfer = API.v1.post(
358359 }
359360 const room = await LivechatRooms . findOneById ( rid ) ;
360361
361- if ( ! room || room . t !== 'l' ) {
362+ if ( room ? .t !== 'l' ) {
362363 return API . v1 . failure ( 'error-invalid-room' ) ;
363364 }
364365
@@ -463,7 +464,7 @@ API.v1.addRoute(
463464
464465 const firstError = result . find ( ( item ) => item . status === 'rejected' ) ;
465466 if ( firstError ) {
466- throw new Error ( ( firstError as PromiseRejectedResult ) . reason . error ) ;
467+ throw new Error ( firstError . reason . error ) ;
467468 }
468469
469470 await callbacks . run ( 'livechat.saveInfo' , await LivechatRooms . findOneById ( roomData . _id ) , {
0 commit comments