tango-app-api-trax 3.3.1-hotfix-10 → 3.3.1-hotfix-11
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
|
@@ -3426,11 +3426,19 @@ export async function updatePlanoStatus( req, res ) {
|
|
|
3426
3426
|
if ( !processCheckDetails ) {
|
|
3427
3427
|
return res.sendError( 'No data found', 204 );
|
|
3428
3428
|
}
|
|
3429
|
-
processCheckDetails.
|
|
3430
|
-
|
|
3429
|
+
let storeTimeZone = await storeService.findOne( { storeName: { $regex: processCheckDetails.storeName, $options: 'i' }, clientId: processCheckDetails.client_id }, { 'storeProfile.timeZone': 1 } );
|
|
3430
|
+
let currentDateTime;
|
|
3431
|
+
if ( storeTimeZone?.storeProfile?.timeZone ) {
|
|
3432
|
+
currentDateTime = dayjs().tz( storeTimeZone?.storeProfile?.timeZone );
|
|
3433
|
+
} else {
|
|
3434
|
+
currentDateTime = requestData?.currentTime ? dayjs( requestData.currentTime, 'HH:mm:ss' ) : dayjs();
|
|
3435
|
+
}
|
|
3436
|
+
let submitTimeString = currentDateTime.format( 'hh:mm A, DD MMM YYYY' );
|
|
3437
|
+
await processedchecklist.updateOne( { _id: req.body.id }, { checklistStatus: req.body.status, ...( req.body.status == 'inprogress' ) ? { startTime_string: submitTimeString } : { submitTime_string: submitTimeString } } );
|
|
3431
3438
|
return res.sendSuccess( 'Status updated Successfully' );
|
|
3432
3439
|
} catch ( e ) {
|
|
3433
3440
|
logger.error( { error: e, function: 'updatePlanoStatus' } );
|
|
3434
3441
|
return res.sendError( e, 500 );
|
|
3435
3442
|
}
|
|
3436
3443
|
}
|
|
3444
|
+
|