I have a members table in my application’s database, where I store application-specific information about a subset of members. One of the columns is discourse_user_id
. I’d like to render a link to the member’s discourse profile. Is it possible to do that with just their user id?
I am not storing discourse_user_name
because the user can change that, and then I’d have to worry about keeping them in sync.
The only way I can think of is to make an API request to /admin/users/<user-id>.json
to get their username, but that would be a large number of requests to do on an index page, where I’m listing members with links to their profile.
The only other thing that comes to mind is to build a plugin to add a route, though that seems like a lot of effort for something that I’d expect I’m not the first person to ask about, so I wanted to check whether there’s another solution already?