(&self, ctx: &Context<'_>)
| 206 | } |
| 207 | |
| 208 | async fn user(&self, ctx: &Context<'_>) -> Result<User> { |
| 209 | let user = ctx |
| 210 | .data_unchecked::<Store>() |
| 211 | .user(self.user_id.clone()) |
| 212 | .await?; |
| 213 | |
| 214 | match user { |
| 215 | Some(user) => Ok(user), |
| 216 | None => Err(Error::NotFound(format!("user not found: {}", self.user_id))), |
| 217 | } |
| 218 | } |
| 219 | } |