(id: uuid::Uuid)
| 629 | } |
| 630 | |
| 631 | pub async fn delete_vendor(id: uuid::Uuid) -> Result<(), Error> { |
| 632 | let ra = diesel::delete(device_profile_vendor::table.find(&fields::Uuid::from(id))) |
| 633 | .execute(&mut get_async_db_conn().await?) |
| 634 | .await?; |
| 635 | |
| 636 | if ra == 0 { |
| 637 | return Err(Error::NotFound(id.to_string())); |
| 638 | } |
| 639 | |
| 640 | info!(id = %id, "Device-profile vendor deleted"); |
| 641 | Ok(()) |
| 642 | } |
| 643 | |
| 644 | pub async fn upsert_device(d: Device) -> Result<Device, Error> { |
| 645 | let d: Device = diesel::insert_into(device_profile_device::table) |