New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feature request: search user by IDs/usernames/phones/emails #2167
Comments
maybe better something like: /api/users?search[id]=1&search[id]=2&search[id]=3&search[username]=Test then if I'm not mistaken, will be able to automatically convert this to an array of ids usernames. what do you think? |
looks great! i have no concern if this works. |
Even though the URL length doesn't matter, I still feel like keeping it like this is simpler and still readable, this makes maintaining code easier by directly doing JSON.parser from the URL params and passing it to the API. |
And also if it's not assigned to anyone I can take this up. |
@5war00p here you go. let's confirm the tech design before you code. one of our engineers will follow this issue |
@wangsijie will follow this issue. |
@wangsijie will this be good to go? |
@5war00p sorry for the late reply. I prefer @RutsuKun's idea which can take advantage of the common HTML standard. But some changes are needed, I tried:
and the {
"id": ["1", "2", "3"],
"username": "foo"
} What do you think about this? I was worried that the JSON way may not be popular and is a bit heavy because we only need an array. |
Yes, this also makes sense, by using But the only thing is URL will have more redundancy, while sharing URL it looks more lengthy. (but this is not a problem as per functionality). |
The "redundancy" is OK? Only when the array have a large length. And even for that case, it will still work. |
Cool, then we can make in that way. How the UX will be for this? means how users will give mutliple ids or usernames, will it be space separated? |
Let's start with the API part. As for the UI, @fleuraly will take a look and post updates here. |
hello, is this issue in development phase? @wangsijie |
@5war00p is working on this, could you post some updates? |
Yeah, I've started it. But I got stuck with DB issues after updating my pnpm version. I have to fix that and move forward. |
how is the progress? |
@5war00p any updates? |
i think @5war00p was busy for this issue, no worries! |
we'll publish this feature with our December release. feel free to open a new issue if it doesn't work. cheers |
What problem did you meet?
/api/users?search=
only supports fuzzy search on multiple fields. Sometimes life needs to be more accurate, e.g., search a user by a specific ID, or a batch of usernames, etc.Describe what you'd like Logto to have
Support something like
/api/users?search=id:1,2,3&mode=exact
to return the exact search result on a specific field.This issue includes:
or
logicTo discuss (we can figure them it together):
search=id:1,2,3
orsearch=1|2|3&field=id
or something else? we are not sure yet)The text was updated successfully, but these errors were encountered: