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

Function update

chirpstack/src/storage/application.rs:323–343  ·  view source on GitHub ↗
(a: Application)

Source from the content-addressed store, hash-verified

321}
322
323pub async fn update(a: Application) -> Result<Application, Error> {
324 a.validate()?;
325
326 let a: Application = diesel::update(application::dsl::application.find(&a.id))
327 .set((
328 application::updated_at.eq(Utc::now()),
329 application::name.eq(&a.name),
330 application::description.eq(&a.description),
331 application::tags.eq(&a.tags),
332 ))
333 .get_result(&mut get_async_db_conn().await?)
334 .await
335 .map_err(|e| Error::from_diesel(e, a.id.to_string()))?;
336
337 info!(
338 application_id = %a.id,
339 "Application updated"
340 );
341
342 Ok(a)
343}
344
345pub async fn update_mqtt_cls_cert(id: &Uuid, cert: &[u8]) -> Result<Application, Error> {
346 let app: Application =

Callers 3

update_mqtt_cls_certFunction · 0.70
update_integrationFunction · 0.70
test_applicationFunction · 0.70

Calls 4

setMethod · 0.80
to_stringMethod · 0.80
get_async_db_connFunction · 0.70
validateMethod · 0.45

Tested by 1

test_applicationFunction · 0.56