try to deploy

Signed-off-by: Kenneth Obsequio <k80308392@gmail.com>
This commit is contained in:
2026-07-13 21:27:37 +08:00
parent f5254f7571
commit c8dc2628a6
9 changed files with 120 additions and 46 deletions
+4 -1
View File
@@ -27,9 +27,12 @@ function safeParseJSON(value, fallback = []) {
function auditInclude(mdl_Users, parentAlias = 'User') {
const tableName = mdl_Users.getTableName();
// Falls back to email when full_name hasn't been filled in (e.g. a
// freshly self-registered account) — better than surfacing the raw
// numeric user_id, which is meaningless in the admin UI.
const fullNameSubquery = (foreignKey) =>
Sequelize.literal(`(
SELECT (u."personal_info"->>'name')::jsonb->>'full_name'
SELECT COALESCE(NULLIF((u."personal_info"->>'name')::jsonb->>'full_name', ''), u."email")
FROM "${tableName}" AS u
WHERE u."user_id" = "${parentAlias}"."${foreignKey}"
LIMIT 1