Update user retrieval API to take both github user id and github login

This commit is contained in:
Max Brunsfeld 2022-09-20 15:40:56 -07:00
parent 9886259b3a
commit 1877fc234b
5 changed files with 165 additions and 39 deletions

View file

@ -5173,17 +5173,25 @@ impl TestServer {
});
let http = FakeHttpClient::with_404_response();
let user_id = if let Ok(Some(user)) = self.app_state.db.get_user_by_github_login(name).await
let user_id = if let Ok(Some(user)) = self
.app_state
.db
.get_user_by_github_account(name, None)
.await
{
user.id
} else {
self.app_state
.db
.create_user(&format!("{name}@example.com"), false, NewUserParams {
github_login: name.into(),
github_user_id: 0,
invite_count: 0,
})
.create_user(
&format!("{name}@example.com"),
false,
NewUserParams {
github_login: name.into(),
github_user_id: 0,
invite_count: 0,
},
)
.await
.unwrap()
};