tango-app-api-trax 3.4.1-alpha-7 → 3.4.1-alpha-8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json
CHANGED
|
@@ -3568,11 +3568,19 @@ export async function updatePlanoStatus( req, res ) {
|
|
|
3568
3568
|
if ( !processCheckDetails ) {
|
|
3569
3569
|
return res.sendError( 'No data found', 204 );
|
|
3570
3570
|
}
|
|
3571
|
-
processCheckDetails.
|
|
3572
|
-
|
|
3571
|
+
let storeTimeZone = await storeService.findOne( { storeName: { $regex: processCheckDetails.storeName, $options: 'i' }, clientId: processCheckDetails.client_id }, { 'storeProfile.timeZone': 1 } );
|
|
3572
|
+
let currentDateTime;
|
|
3573
|
+
if ( storeTimeZone?.storeProfile?.timeZone ) {
|
|
3574
|
+
currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
|
|
3575
|
+
} else {
|
|
3576
|
+
currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
|
|
3577
|
+
}
|
|
3578
|
+
let submitTimeString = currentDateTime.format( 'hh:mm A, DD MMM YYYY' );
|
|
3579
|
+
await processedchecklist.updateOne( { _id: req.body.id }, { checklistStatus: req.body.status, ...( req.body.status == 'inprogress' ) ? { startTime_string: submitTimeString } : { submitTime_string: submitTimeString } } );
|
|
3573
3580
|
return res.sendSuccess( 'Status updated Successfully' );
|
|
3574
3581
|
} catch ( e ) {
|
|
3575
3582
|
logger.error( { error: e, function: 'updatePlanoStatus' } );
|
|
3576
3583
|
return res.sendError( e, 500 );
|
|
3577
3584
|
}
|
|
3578
3585
|
}
|
|
3586
|
+
|