fix(shared): link-field where query must use (customer.Id,eq,N) not (customer,eq,N)

- calculateEffectiveGrants queried CustomerProducts/AccessGrants with
  (customer,eq,N), which matches the link field's DISPLAY NAME and always
  returns 0 rows -> desiredPaths always [] -> W1/W2/W3 write empty scopes.
- Regression from the shared-lib refactor (3ecee30): W2 had already fixed
  this in 36a6b3b but the shared extract reverted to the old syntax.
- Correct syntax (customer.Id,eq,N) verified against live NocoDB for
  customer 6 -> /Class/Health, /Class/Other, /Template/Music.
- Updated all three test mocks to match the corrected where clause.
This commit is contained in:
2026-08-23 06:55:04 +08:00
parent 9bcdfc2049
commit 21e3a3b45f
7 changed files with 14 additions and 11 deletions
+2 -2
View File
@@ -64,11 +64,11 @@ function makeCtx() {
}
if (u.includes('/tr/records?limit=10000')) return { list: RESOURCES };
// CustomerProducts where customer eq
if (u.includes('/tcpc/records?where=(customer,eq,')) {
if (u.includes('/tcpc/records?where=(customer.Id,eq,')) {
return { list: CUSTOMERPRODUCTS };
}
// AccessGrants where customer eq
if (u.includes('/tag/records?where=(customer,eq,')) {
if (u.includes('/tag/records?where=(customer.Id,eq,')) {
return { list: ACCESSGRANTS };
}
// Product M2M link