@7365admin1/core 3.47.1-staging.126 → 3.47.1-staging.129
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/.changeset/members-paging-skip.md +18 -0
- package/.changeset/service-provider-org-filter.md +17 -0
- package/.changeset/users-list-staff-guard.md +17 -0
- package/dist/index.js +316 -310
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +42 -36
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/test/member-paging.test.mjs +93 -0
- package/test/service-provider-query-keys.test.mjs +102 -0
- package/test/staff-console-authz.test.mjs +48 -2
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Fix GET /api/members returning the same page over and over
|
|
6
|
+
|
|
7
|
+
`member.repo.ts` `getAll` built its aggregate with `{ $limit: limit }` and no
|
|
8
|
+
`$skip`. `paginate()` only *labels* the range — it returns `items` untouched and
|
|
9
|
+
computes `pageRange` arithmetically — so the server answered page 2 with page
|
|
10
|
+
1's rows under an "11-20 of 42" heading. Every Members screen in every app was
|
|
11
|
+
affected, not one screen.
|
|
12
|
+
|
|
13
|
+
`{ $skip: page * limit }` is added ahead of the limit, matching the two
|
|
14
|
+
`getOrgs*` reads in the same file that were already correct. `page` is
|
|
15
|
+
zero-based by then, and the cache key already varies by page, so no cache
|
|
16
|
+
change is needed.
|
|
17
|
+
|
|
18
|
+
The response shape is unchanged: `{ items, pages, pageRange }`.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Fix the ignored serviceProviderOrgId filter on GET /api/service-providers
|
|
6
|
+
|
|
7
|
+
`service-provider.controller.ts` `getServiceProviders` validated
|
|
8
|
+
`serviceProviderOrgId` in its Joi schema but read
|
|
9
|
+
`req.query.serviceProviderId`. Joi rejects unknown keys, so no caller could
|
|
10
|
+
ever send the name that was read — the value was permanently `undefined` and
|
|
11
|
+
the documented filter was silently ignored, answering with every service
|
|
12
|
+
provider rather than the one organisation's.
|
|
13
|
+
|
|
14
|
+
The read now uses the key the schema declares. The repository already handled
|
|
15
|
+
`serviceProviderOrgId` correctly, so nothing below the controller changes.
|
|
16
|
+
|
|
17
|
+
Raised in web-app-org #142.
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
---
|
|
2
|
+
"@7365admin1/core": patch
|
|
3
|
+
---
|
|
4
|
+
|
|
5
|
+
Require Seven365 staff to read the platform-wide user list
|
|
6
|
+
|
|
7
|
+
`GET /api/users` was `requireAuth` only. It is not filtered by organisation or
|
|
8
|
+
by site, so it returns every account on the platform — every client's residents,
|
|
9
|
+
guards and cleaners — and any signed-in account could page through the lot.
|
|
10
|
+
|
|
11
|
+
It now calls `requirePlatformStaff`, the same gate the rest of the staff console
|
|
12
|
+
uses. No second mechanism is introduced.
|
|
13
|
+
|
|
14
|
+
The per-user endpoints in the same controller (`getById`, `getByEmail`,
|
|
15
|
+
`getUsersByOrgId`, the profile and password writes) are deliberately unchanged —
|
|
16
|
+
they are a person's own account, not a cross-tenant read — and a test pins that
|
|
17
|
+
so a later sweep cannot close them by reflex.
|