@opengis/fastify-table 2.0.27 → 2.0.28
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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tableData.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/tableData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,wBAA8B,YAAY,CACxC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,YAAY,EACnB,MAAM,CAAC,EAAE,GAAG,
|
|
1
|
+
{"version":3,"file":"tableData.d.ts","sourceRoot":"","sources":["../../../../../server/routes/table/controllers/tableData.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAMvC,wBAA8B,YAAY,CACxC,GAAG,EAAE,GAAG,EACR,KAAK,EAAE,YAAY,EACnB,MAAM,CAAC,EAAE,GAAG,gBA+Bb"}
|
|
@@ -6,7 +6,7 @@ export default async function getTableData(req, reply, called) {
|
|
|
6
6
|
const q = `select attr,
|
|
7
7
|
(select rule_values from admin.account_grants where account_id in (select account_id from admin.account_users where user_uid=$2) and rule_id=r.rule_id limit 1)
|
|
8
8
|
from admin.rules r where (select route_id from admin.routes where $1 in (alias,table_name)) = any(routes)`;
|
|
9
|
-
const { rows = [] } = pg?.pk?.["admin.rules"]
|
|
9
|
+
const { rows = [] } = pg?.pk?.["admin.rules"] && user?.uid
|
|
10
10
|
? await pg.query(q, [params.table, user.uid])
|
|
11
11
|
: {};
|
|
12
12
|
const contextQuery = rows
|
|
@@ -54,9 +54,9 @@ export default async function dataAPI({ pg = pgClients.client, params, headers =
|
|
|
54
54
|
return { message: hookData?.message, status: hookData?.status };
|
|
55
55
|
}
|
|
56
56
|
/* from tableData START */
|
|
57
|
-
const tokenData1 = await getOpt(params.table,
|
|
57
|
+
const tokenData1 = await getOpt(params.table, uid);
|
|
58
58
|
const tokenData2 = await getToken({
|
|
59
|
-
uid
|
|
59
|
+
uid,
|
|
60
60
|
token: params.table,
|
|
61
61
|
json: true,
|
|
62
62
|
});
|
|
@@ -435,7 +435,7 @@ export default async function dataAPI({ pg = pgClients.client, params, headers =
|
|
|
435
435
|
.forEach((el) => {
|
|
436
436
|
item[el] = handlebarsSync.compile(item[el])({
|
|
437
437
|
user,
|
|
438
|
-
uid
|
|
438
|
+
uid,
|
|
439
439
|
id,
|
|
440
440
|
data: rows[0],
|
|
441
441
|
});
|
|
@@ -446,7 +446,7 @@ export default async function dataAPI({ pg = pgClients.client, params, headers =
|
|
|
446
446
|
uid,
|
|
447
447
|
array: 1,
|
|
448
448
|
})[0]
|
|
449
|
-
: setOpt(item,
|
|
449
|
+
: setOpt(item, uid);
|
|
450
450
|
tokens[key] = token;
|
|
451
451
|
});
|
|
452
452
|
}
|
|
@@ -496,7 +496,7 @@ export default async function dataAPI({ pg = pgClients.client, params, headers =
|
|
|
496
496
|
const q2 = handlebarsSync.compile(el.sql)({
|
|
497
497
|
data: rows[0],
|
|
498
498
|
user,
|
|
499
|
-
uid
|
|
499
|
+
uid,
|
|
500
500
|
id,
|
|
501
501
|
});
|
|
502
502
|
const { rows: sqlData } = await pg.query(q2);
|