API route to look up user by username#2
Open
sussycatgirl wants to merge 3 commits intorevoltchat:masterfrom
Open
API route to look up user by username#2sussycatgirl wants to merge 3 commits intorevoltchat:masterfrom
sussycatgirl wants to merge 3 commits intorevoltchat:masterfrom
Conversation
arktn
approved these changes
Mar 15, 2023
arktn
left a comment
There was a problem hiding this comment.
Would be great to make bot development simpler! 👍
nulldg
reviewed
May 16, 2023
sharkaccino
reviewed
May 16, 2023
| # Drawbacks | ||
|
|
||
| - Might require another index in MongoDB | ||
| - Since the backend needs to make sure the returned users are mutual, there might be more processing overhead involved, but the logic for this can probably be copied from the /users/:id route |
This comment was marked as resolved.
This comment was marked as resolved.
Sorry, something went wrong.
insertish
reviewed
Jun 8, 2023
|
|
||
| # Guide-level explanation | ||
|
|
||
| Send a `GET` request to `/users/by-name/insert` (no idea how to name the route) to get an array of users matching that username. |
Member
There was a problem hiding this comment.
This should probably be a POST to /users/by-name or something along those lines using the body to specify username and later discriminator.
Rexogamer
suggested changes
Mar 15, 2024
| The `exact` field should default to true and indicates whether we want an exact match (still case insensitive) or if we want to receive all users starting with the search term, similar to Discord's user search - See [below](#prior-art). \ | ||
| Setting this to `false` will make this endpoint feasable as a replacement for the current temporary [member search route](https://github.com/revoltchat/backend/commit/d81d08f1ce222a9fe05986e15c4e3748bdd5d4ae). | ||
|
|
||
| If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point. |
Contributor
There was a problem hiding this comment.
Suggested change
| If this is implemented before discriminators are, the `discriminator` field should be supported as a placeholder and functionality can be added at a later point. |
Contributor
|
I strongly oppose this proposal. This is computationally expensive for certain database layouts. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.