From b136071e8cbba2acb1e02728483b8b461ff59706 Mon Sep 17 00:00:00 2001 From: Franklin Date: Tue, 25 Apr 2023 06:22:02 -0400 Subject: [PATCH] Added delete client routes to the api --- src/api/backend/mod.rs | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/src/api/backend/mod.rs b/src/api/backend/mod.rs index f7cb357..0c9e87d 100644 --- a/src/api/backend/mod.rs +++ b/src/api/backend/mod.rs @@ -222,6 +222,30 @@ pub async fn delete_project(project_id: &Uuid) -> Result<(), err::Error> { .await } +pub async fn delete_agent(agent_id: &Uuid) -> Result<(), err::Error> { + perform_request_without_client::( + BASE_URL.into(), + Method::DELETE, + format!("admin/agent/{agent_id}"), + None, + 200, + Vec::new(), + None, + ) + .await +} +pub async fn delete_unit(unit_id: &Uuid) -> Result<(), err::Error> { + perform_request_without_client::( + BASE_URL.into(), + Method::DELETE, + format!("admin/unit/{unit_id}"), + None, + 200, + Vec::new(), + None, + ) + .await +} pub async fn upload_image(item: Item, body: Vec) -> Result { perform_multipart_request_without_client(