@7365admin1/core 3.52.10 → 3.52.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +11 -1
- package/dist/index.js +12 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +12 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/visitor-document-site-scope.test.mjs +82 -0
package/dist/index.mjs
CHANGED
|
@@ -19743,7 +19743,8 @@ function useVisitorTransactionRepo() {
|
|
|
19743
19743
|
checkedOut,
|
|
19744
19744
|
plateNumber = "",
|
|
19745
19745
|
tab = "",
|
|
19746
|
-
passOrKey
|
|
19746
|
+
passOrKey,
|
|
19747
|
+
siteScope
|
|
19747
19748
|
}) {
|
|
19748
19749
|
page = page > 0 ? page - 1 : 0;
|
|
19749
19750
|
const skip = page * limit;
|
|
@@ -19764,6 +19765,11 @@ function useVisitorTransactionRepo() {
|
|
|
19764
19765
|
const query2 = {
|
|
19765
19766
|
...ObjectId40.isValid(org) && { org: new ObjectId40(org) },
|
|
19766
19767
|
...ObjectId40.isValid(site) && { site: new ObjectId40(site) },
|
|
19768
|
+
...siteScope ? {
|
|
19769
|
+
site: {
|
|
19770
|
+
$in: siteScope.filter((id) => ObjectId40.isValid(id)).map((id) => new ObjectId40(id))
|
|
19771
|
+
}
|
|
19772
|
+
} : {},
|
|
19767
19773
|
...Object.keys(checkInFilter).length > 0 && { checkIn: checkInFilter },
|
|
19768
19774
|
...Object.keys(expectedCheckInFilter).length > 0 && {
|
|
19769
19775
|
expectedCheckIn: expectedCheckInFilter
|
|
@@ -56715,12 +56721,16 @@ function useVisitorTransactionController() {
|
|
|
56715
56721
|
tab,
|
|
56716
56722
|
passOrKey
|
|
56717
56723
|
} = value;
|
|
56724
|
+
const siteScope = site ? null : await entitledSites(req);
|
|
56725
|
+
if (site)
|
|
56726
|
+
await requireSiteReach(req, site);
|
|
56718
56727
|
const sortObj = {
|
|
56719
56728
|
[sort ? sort : "_id" /* ID */]: order === "asc" /* ASC */ ? 1 : -1
|
|
56720
56729
|
};
|
|
56721
56730
|
const data = await _getAll({
|
|
56722
56731
|
org,
|
|
56723
56732
|
site,
|
|
56733
|
+
siteScope,
|
|
56724
56734
|
search,
|
|
56725
56735
|
page,
|
|
56726
56736
|
limit,
|
|
@@ -64199,6 +64209,7 @@ function useDocumentManagementController() {
|
|
|
64199
64209
|
const site = req.query.site ?? "";
|
|
64200
64210
|
const parentId = req.query.parentId ?? "";
|
|
64201
64211
|
try {
|
|
64212
|
+
await requireSiteReach(req, site);
|
|
64202
64213
|
const data = await _getDocuments({
|
|
64203
64214
|
search,
|
|
64204
64215
|
page,
|