MCPcopy Create free account
hub / github.com/chirpstack/chirpstack / delete_vendor

Function delete_vendor

chirpstack/src/storage/device_profile.rs:631–642  ·  view source on GitHub ↗
(id: uuid::Uuid)

Source from the content-addressed store, hash-verified

629}
630
631pub 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
644pub async fn upsert_device(d: Device) -> Result<Device, Error> {
645 let d: Device = diesel::insert_into(device_profile_device::table)

Callers 2

test_device_profileFunction · 0.85
delete_vendorMethod · 0.85

Calls 3

to_stringMethod · 0.80
deleteFunction · 0.70
get_async_db_connFunction · 0.70

Tested by 1

test_device_profileFunction · 0.68