@7365admin1/core 3.16.0 → 3.17.0

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/dist/index.mjs CHANGED
@@ -8333,7 +8333,22 @@ function useUserRepo() {
8333
8333
  as: "unitInfo"
8334
8334
  }
8335
8335
  },
8336
- { $unwind: { path: "$unitInfo", preserveNullAndEmptyArrays: true } }
8336
+ { $unwind: { path: "$unitInfo", preserveNullAndEmptyArrays: true } },
8337
+ {
8338
+ $lookup: {
8339
+ from: "sites",
8340
+ localField: "site",
8341
+ foreignField: "_id",
8342
+ pipeline: [{ $project: { _id: 0, category: 1 } }],
8343
+ as: "siteInfo"
8344
+ }
8345
+ },
8346
+ {
8347
+ $addFields: {
8348
+ siteCategory: { $first: "$siteInfo.category" }
8349
+ }
8350
+ },
8351
+ { $project: { siteInfo: 0 } }
8337
8352
  ]).toArray();
8338
8353
  const data = results.length > 0 ? results[0] : null;
8339
8354
  if (!data) {