added admin page and audit log viewing

This commit is contained in:
2026-02-11 19:07:40 +11:00
parent 2a3f4e4861
commit 4c80165f01
22 changed files with 1298 additions and 155 deletions

View File

@@ -141,3 +141,9 @@ func GetUsers(ctx context.Context, tx bun.Tx, pageOpts *PageOpts) (*List[User],
defaults := &PageOpts{1, 50, bun.OrderAsc, "id"}
return GetList[User](tx).GetPaged(ctx, pageOpts, defaults)
}
// GetUsersWithRoles queries the database for users with their roles preloaded
func GetUsersWithRoles(ctx context.Context, tx bun.Tx, pageOpts *PageOpts) (*List[User], error) {
defaults := &PageOpts{1, 25, bun.OrderAsc, "id"}
return GetList[User](tx).Relation("Roles").GetPaged(ctx, pageOpts, defaults)
}