Update POST me/friend endpoint to take username instead of UUID #31
1 changed files with 3 additions and 3 deletions
|
@ -170,12 +170,12 @@ pub async fn user_uuid_from_identifier(
|
|||
|
||||
pub async fn user_uuid_from_username(
|
||||
conn: &mut Conn,
|
||||
identifier: &String,
|
||||
username: &String,
|
||||
) -> Result<Uuid, Error> {
|
||||
if USERNAME_REGEX.is_match(identifier) {
|
||||
if USERNAME_REGEX.is_match(username) {
|
||||
use users::dsl;
|
||||
let user_uuid = dsl::users
|
||||
.filter(dsl::username.eq(identifier))
|
||||
.filter(dsl::username.eq(username))
|
||||
.select(dsl::uuid)
|
||||
.get_result(conn)
|
||||
.await?;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue