File tree Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Expand file tree Collapse file tree 3 files changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -144,7 +144,7 @@ exports.updateTokens = functions.pubsub.schedule(cron).onRun(() => {
144144} )
145145console . log ( `-- Sheduled update E-Com Plus tokens '${ cron } '` )
146146
147- const cronSendOrders = '12,41 * * * *'
147+ const cronSendOrders = '16,47 * * * *'
148148const sendWaitingOrders = require ( './lib/integration/send-waiting-orders' )
149149exports . sendWaitingOrders = functions . runWith ( { timeoutSeconds : 300 } )
150150 . pubsub . schedule ( cronSendOrders ) . onRun ( sendWaitingOrders )
Original file line number Diff line number Diff line change @@ -45,8 +45,8 @@ module.exports = async (
4545 return
4646 }
4747 const trackingId = ( mandaeOrderSettings . tracking_prefix || '' ) +
48- invoice . number . replace ( / ^ 0 + / , '' ) +
49- invoice . serial_number . replace ( / ^ 0 + / , '' )
48+ invoice . number . replace ( / ^ 0 + / , '' ) . trim ( ) +
49+ invoice . serial_number . replace ( / ^ 0 + / , '' ) . trim ( )
5050 const lineTrackingCodes = shippingLine . tracking_codes || [ ]
5151 const savedTrackingCode = lineTrackingCodes . find ( ( { code } ) => {
5252 return code === trackingId
Original file line number Diff line number Diff line change @@ -43,8 +43,8 @@ module.exports = async (
4343 mandaeTrackingPrefix = storeId === 1024 ? 'TIA' : ''
4444 }
4545 const trackingId = mandaeTrackingPrefix +
46- invoice . number . replace ( / ^ 0 + / , '' ) +
47- invoice . serial_number . replace ( / ^ 0 + / , '' )
46+ invoice . number . replace ( / ^ 0 + / , '' ) . trim ( ) +
47+ invoice . serial_number . replace ( / ^ 0 + / , '' ) . trim ( )
4848 logger . info ( `Tracking #${ storeId } ${ number } with ID ${ trackingId } ` )
4949 const { data } = await axios . get ( `https://api.mandae.com.br/v3/trackings/${ trackingId } ` , {
5050 headers : { Authorization : mandaeToken } ,
You can’t perform that action at this time.
0 commit comments