@@ -53,6 +53,7 @@ if (!CONSOLE_MODE) {
5353 } ) ;
5454 req . results . $count = offlineQueues . length ;
5555 return ;
56+ }
5657}
5758/**
5859 * Handles the print request.
@@ -124,23 +125,21 @@ const print = async function (_, req) {
124125
125126 // Print Task
126127 let printTaskResp ;
127- try {
128- printTaskResp = await api . put ( `/qm/api/v1/rest/print-tasks/${ itemId } ` , printTask ) ;
129- } catch ( e ) {
130- logger . error ( 'Error in sending to print queue: ' , e . response ?. data ?. error ?. message ) ;
131- return req . error ( 'Print task failed' ) ;
128+ try {
129+ printTaskResp = await api . put ( `/qm/api/v1/rest/print-tasks/${ itemId } ` , printTask ) ;
130+ } catch ( e ) {
131+ logger . error ( 'Error in sending to print queue: ' , e . response ?. data ?. error ?. message ) ;
132+ return req . error ( 'Print task failed' ) ;
133+ }
134+ logger . info ( `Document sent to print queue ${ qname } ` ) ;
135+ return req . info ( 200 , `Document sent to print queue ${ qname } \n
136+ No. of copies requested: ${ numberOfCopies } ` ) ;
137+ } else {
138+ // Offline / Console Mode
139+ docsToPrint . forEach ( ( doc ) => {
140+ logger . info ( `Document ${ doc . fileName } sent to print queue ${ qname } ` ) ;
141+ } ) ;
132142 }
133- logger . info ( `Document sent to print queue ${ qname } ` ) ;
134- return req . info ( 200 , `Document sent to print queue ${ qname } \n
135- No. of copies requested: ${ numberOfCopies } ` ) ;
136- } else {
137- // Offline / Console Mode
138- docsToPrint . forEach ( ( doc ) => {
139- logger . info ( `Document ${ doc . fileName } sent to print queue ${ qname } ` ) ;
140- } ) ;
141- }
142-
143- }
144143}
145144
146145module . exports = { print, populateQueueValueHelp } ;
0 commit comments