Skip to content

Commit

Permalink
significant errors
Browse files Browse the repository at this point in the history
  • Loading branch information
arlen22 committed Jan 10, 2025
1 parent 01ec422 commit be5dbb3
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 10 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -58,29 +58,33 @@ exports.handler = async function (request, response, state) {
// Enhance ACL records with role and permission details
recipeAclRecords = recipeAclRecords.map(record => {
var role = roles.find(role => role.role_id === record.role_id);
if(!role) $tw.utils.warning("Role not found for record " + record.acl_id);
var permission = permissions.find(perm => perm.permission_id === record.permission_id);
if(!permission) $tw.utils.warning("Permission not found for record " + record.acl_id);
return ({
...record,
role,
permission,
role_name: role.role_name,
role_description: role.description,
permission_name: permission.permission_name,
permission_description: permission.description
role_name: role?.role_name,
role_description: role?.description,
permission_name: permission?.permission_name,
permission_description: permission?.description
})
});

bagAclRecords = bagAclRecords.map(record => {
var role = roles.find(role => role.role_id === record.role_id);
if(!role) $tw.utils.warning("Role not found for record " + record.acl_id);
var permission = permissions.find(perm => perm.permission_id === record.permission_id);
if(!permission) $tw.utils.warning("Permission not found for record " + record.acl_id);
return ({
...record,
role,
permission,
role_name: role.role_name,
role_description: role.description,
permission_name: permission.permission_name,
permission_description: permission.description
role_name: role?.role_name,
role_description: role?.description,
permission_name: permission?.permission_name,
permission_description: permission?.description
})
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -903,7 +903,7 @@ SqlTiddlerDatabase.prototype.listUsersByRoleId = async function(roleId) {
};

SqlTiddlerDatabase.prototype.updateUser = async function (userId, username, email, roleId) {
const existingUser = await this.engine.runStatement(`
const existingUser = await this.engine.runStatementGet(`
SELECT user_id FROM users
WHERE email = $email AND user_id != $userId
`, {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ SqlTiddlerStore.prototype.saveTiddlersFromPath = async function(tiddler_files_pa
// Save the tiddlers
for(const tiddlersFromFile of tiddlersFromPath) {
for(const tiddler of tiddlersFromFile.tiddlers) {
await self.saveBagTiddler(tiddler,bag_name,null);
await self.saveBagTiddler(tiddler,bag_name);
}
}
});
Expand Down

0 comments on commit be5dbb3

Please sign in to comment.