tango-app-api-store-builder 1.0.0-beta-195 → 1.0.0-beta-196

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-195",
3
+ "version": "1.0.0-beta-196",
4
4
  "description": "storeBuilder",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -874,7 +874,33 @@ export async function replaceFixtureDetails( req, res ) {
874
874
  }
875
875
  if ( inputData.storeList.length == 0 && inputData.publishAll ) {
876
876
  await fixtureConfigService.updateOne( { _id: inputData.replaceFixture }, { isEdited: false } );
877
- inputData.storeList = await storeFixtureService.find( { fixtureConfigId: inputData.findFixture }, { storeId: 1 } );
877
+ let query = [
878
+ {
879
+ $match: {
880
+ fixtureConfigId: new ObjectId( inputData.findFixture ),
881
+ },
882
+ },
883
+ {
884
+ $group: {
885
+ _id: '$storeId',
886
+ floorDetails: {
887
+ $first: {
888
+ _id: '$floorId',
889
+ },
890
+ },
891
+ },
892
+ },
893
+ {
894
+ $project: {
895
+ storeId: '$_id',
896
+ floorDetails: 1,
897
+ _id: 0,
898
+ },
899
+ },
900
+ ];
901
+
902
+ // inputData.storeList = await storeFixtureService.find( { fixtureConfigId: inputData.findFixture }, { storeId: 1 } );
903
+ inputData.storeList = await storeFixtureService.aggregate( query );
878
904
  let data = {
879
905
  templateId: inputData.replaceFixture,
880
906
  data: replaceFixtureData,