(external_id: &str)
| 92 | } |
| 93 | |
| 94 | pub async fn get_by_external_id(external_id: &str) -> Result<User, Error> { |
| 95 | let u = user::dsl::user |
| 96 | .filter(user::dsl::external_id.eq(external_id)) |
| 97 | .first(&mut get_async_db_conn().await?) |
| 98 | .await |
| 99 | .map_err(|e| Error::from_diesel(e, external_id.to_string()))?; |
| 100 | Ok(u) |
| 101 | } |
| 102 | |
| 103 | pub async fn get_by_email_and_pw(email: &str, pw: &str) -> Result<User, Error> { |
| 104 | let u: User = match user::dsl::user |