File tree Expand file tree Collapse file tree 1 file changed +7
-5
lines changed
apps/meteor/app/api/server/v1 Expand file tree Collapse file tree 1 file changed +7
-5
lines changed Original file line number Diff line number Diff line change @@ -156,7 +156,7 @@ const callHistoryListEndpoints = API.v1.get(
156156
157157type CallHistoryListEndpoints = ExtractRoutesFromAPI < typeof callHistoryListEndpoints > ;
158158
159- type CallHistoryInfo = { historyId : string ; callId : never } | { callId : string ; historyId : never } ;
159+ type CallHistoryInfo = { historyId : string } | { callId : string } ;
160160
161161const CallHistoryInfoSchema = {
162162 oneOf : [
@@ -224,13 +224,15 @@ const callHistoryInfoEndpoints = API.v1.get(
224224 authRequired : true ,
225225 } ,
226226 async function action ( ) {
227- if ( ! this . queryParams . historyId && ! this . queryParams . callId ) {
227+ const { historyId, callId } = this . queryParams as Record < string , never > & typeof this . queryParams ;
228+
229+ if ( ! historyId && ! callId ) {
228230 return API . v1 . failure ( ) ;
229231 }
230232
231- const item = await ( this . queryParams . historyId
232- ? CallHistory . findOneByIdAndUid ( this . queryParams . historyId , this . userId )
233- : CallHistory . findOneByCallIdAndUid ( this . queryParams . callId , this . userId ) ) ;
233+ const item = await ( historyId
234+ ? CallHistory . findOneByIdAndUid ( historyId , this . userId )
235+ : CallHistory . findOneByCallIdAndUid ( callId , this . userId ) ) ;
234236
235237 if ( ! item ) {
236238 return API . v1 . notFound ( ) ;
You can’t perform that action at this time.
0 commit comments