(a: Application)
| 298 | } |
| 299 | |
| 300 | pub async fn create(a: Application) -> Result<Application, Error> { |
| 301 | a.validate()?; |
| 302 | |
| 303 | let a: Application = diesel::insert_into(application::table) |
| 304 | .values(&a) |
| 305 | .get_result(&mut get_async_db_conn().await?) |
| 306 | .await |
| 307 | .map_err(|e| Error::from_diesel(e, a.id.to_string()))?; |
| 308 | |
| 309 | info!(id = %a.id, "Application created"); |
| 310 | |
| 311 | Ok(a) |
| 312 | } |
| 313 | |
| 314 | pub async fn get(id: &Uuid) -> Result<Application, Error> { |
| 315 | let a = application::dsl::application |
no test coverage detected