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

Function delete

chirpstack/src/storage/tenant.rs:252–263  ·  view source on GitHub ↗
(id: &Uuid)

Source from the content-addressed store, hash-verified

250}
251
252pub async fn delete(id: &Uuid) -> Result<(), Error> {
253 let ra = diesel::delete(tenant::dsl::tenant.find(&fields::Uuid::from(id)))
254 .execute(&mut get_async_db_conn().await?)
255 .await
256 .map_err(|e| Error::from_diesel(e, id.to_string()))?;
257
258 if ra == 0 {
259 return Err(Error::NotFound(id.to_string()));
260 }
261 info!(id = %id, "Tenant deleted");
262 Ok(())
263}
264
265pub async fn get_count(filters: &Filters) -> Result<i64, Error> {
266 let mut q = tenant::dsl::tenant

Callers 3

update_userFunction · 0.70
delete_userFunction · 0.70
test_tenantFunction · 0.70

Calls 2

to_stringMethod · 0.80
get_async_db_connFunction · 0.70

Tested by 1

test_tenantFunction · 0.56