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 mockHttp(opts) {
if (u.includes('/tr/records?limit=10000')) return { list: state.resources };
// CP where customer eq
const cpm = u.match(/tcpc\/records\?where=\(customer,eq,(\d+)\)/);
const cpm = u.match(/tcpc\/records\?where=\(customer\.Id,eq,(\d+)\)/);
if (cpm) return { list: state.cps.filter(c => c.customer === Number(cpm[1])) };
// grants where customer eq
const gm = u.match(/tag\/records\?where=\(customer,eq,(\d+)\)/);
const gm = u.match(/tag\/records\?where=\(customer\.Id,eq,(\d+)\)/);
if (gm) return { list: state.grants.filter(g => g.customer === Number(gm[1])) };
// product M2M