tango-app-api-store-builder 1.0.0-beta-139 → 1.0.0-beta-141

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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "tango-app-api-store-builder",
3
- "version": "1.0.0-beta-139",
3
+ "version": "1.0.0-beta-141",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -453,6 +453,12 @@ export async function getTemplateList( req, res ) {
453
453
  count: fixtureDetails[0].count[0].total,
454
454
  data: fixtureDetails[0].templateData,
455
455
  };
456
+
457
+ result.data.forEach( ( ele ) => {
458
+ ele.productBrandName = [ ...new Set( ele.productBrandName.map( ( product ) => product ) ) ];
459
+ ele.productCategory = [ ...new Set( ele.productCategory.map( ( product ) => product ) ) ];
460
+ ele.productSubCategory = [ ...new Set( ele.productSubCategory.map( ( product ) => product ) ) ];
461
+ } );
456
462
  return res.sendSuccess( result );
457
463
  } catch ( e ) {
458
464
  console.log( e );
@@ -290,14 +290,14 @@ export async function createTask( req, res ) {
290
290
  taskData.userName = userDetails.userName;
291
291
  taskData.userEmail = userDetails.email;
292
292
  taskData.planoId = planoDetails?._id;
293
+ let planoProgress = req.body.checkListName == 'Fixture Verification' ? 50 : req.body.checkListName == 'VM Verification' ? 75 : 25;
294
+ if ( req.body?.checkListName && req.body.checkListName == 'Layout Verification' ) {
295
+ await planoTaskService.deleteMany( { planoId: planoDetails?._id, floorId: taskData?.floorId } );
296
+ planoProgress = 25;
297
+ await processedService.deleteMany( { planoId: planoDetails?._id, floorId: taskData?.floorId, isPlano: true } );
298
+ }
299
+ await planoService.updateOne( { _id: planoDetails?._id }, { $set: { planoProgress } } );
293
300
  for ( let j=0; j<req.body.days; j++ ) {
294
- let planoProgress = req.body.checkListName == 'Fixture Verification' ? 50 : req.body.checkListName == 'VM Verification' ? 75 : 25;
295
- if ( req.body?.checkListName && req.body.checkListName == 'Layout Verification' ) {
296
- await planoTaskService.deleteMany( { planoId: planoDetails?._id, floorId: taskData?.floorId } );
297
- planoProgress = 25;
298
- await processedService.deleteMany( { planoId: planoDetails?._id, floorId: taskData?.floorId, isPlano: true } );
299
- }
300
- await planoService.updateOne( { _id: planoDetails?._id }, { $set: { planoProgress } } );
301
301
  let currDate = dayjs().add( j, 'day' );
302
302
  let time = '12:00 AM';
303
303
  if ( currDate.format( 'YYYY-MM-DD' ) == dayjs().format( 'YYYY-MM-DD' ) ) {