File tree Expand file tree Collapse file tree
lib/server/services/qualityControlFlag Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -537,20 +537,19 @@ class QcFlagService {
537537 * @throws {BadParameterError }
538538 */
539539 _prepareQcFlagPeriod ( timestamps , targetRun ) {
540- const { qcTimeStart, qcTimeEnd } = targetRun ;
541- const runStart = qcTimeStart ?. getTime ( ) ;
542- const runEnd = qcTimeEnd ?. getTime ( ) ;
540+ const qcTimeStart = targetRun . qcTimeStart ?. getTime ( ) ;
541+ const qcTimeEnd = targetRun . qcTimeEnd ?. getTime ( ) ;
543542
544543 const { from, to } = timestamps ;
545544
546545 if ( from && to && from >= to ) {
547546 throw new BadParameterError ( 'Parameter "to" timestamp must be greater than "from" timestamp' ) ;
548547 }
549548
550- const isFromOutOfRange = from && ( runStart && from < runStart || runEnd && runEnd <= from ) ;
551- const isToOutOfRange = to && ( runStart && to <= runStart || runEnd && runEnd < to ) ;
549+ const isFromOutOfRange = from && ( qcTimeStart && from < qcTimeStart || qcTimeEnd && qcTimeEnd <= from ) ;
550+ const isToOutOfRange = to && ( qcTimeStart && to <= qcTimeStart || qcTimeEnd && qcTimeEnd < to ) ;
552551 if ( isFromOutOfRange || isToOutOfRange ) {
553- throw new BadParameterError ( `Given QC flag period (${ from } , ${ to } ) is out of run (${ runStart } , ${ runEnd } ) period` ) ;
552+ throw new BadParameterError ( `Given QC flag period (${ from } , ${ to } ) is out of run (${ qcTimeStart } , ${ qcTimeEnd } ) period` ) ;
554553 }
555554
556555 return { from, to } ;
You can’t perform that action at this time.
0 commit comments