Cargofmt
This commit is contained in:
parent
b136071e8c
commit
a4255eb4fd
@ -184,6 +184,7 @@ pub async fn create_new_project(project: NewProjectPayload) -> Result<Project, e
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn create_location(location: NewLocationPayload) -> Result<Location, err::Error> {
|
||||
perform_request_without_client(
|
||||
BASE_URL.into(),
|
||||
@ -196,6 +197,7 @@ pub async fn create_location(location: NewLocationPayload) -> Result<Location, e
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn update_project(project: UpdateProjectPayload) -> Result<Project, err::Error> {
|
||||
perform_request_without_client(
|
||||
BASE_URL.into(),
|
||||
@ -234,6 +236,7 @@ pub async fn delete_agent(agent_id: &Uuid) -> Result<(), err::Error> {
|
||||
)
|
||||
.await
|
||||
}
|
||||
|
||||
pub async fn delete_unit(unit_id: &Uuid) -> Result<(), err::Error> {
|
||||
perform_request_without_client::<String, ()>(
|
||||
BASE_URL.into(),
|
||||
|
@ -3,8 +3,9 @@ use yew::prelude::*;
|
||||
use yew_router::prelude::use_navigator;
|
||||
|
||||
use crate::{
|
||||
api::backend::delete_project,
|
||||
pages::admin::edit::{EditItem, EditType},
|
||||
routes::main_router::Route, api::backend::delete_project,
|
||||
routes::main_router::Route,
|
||||
};
|
||||
|
||||
#[function_component(AdminProject)]
|
||||
@ -24,8 +25,10 @@ pub fn admin_project(props: &AdminProjectProps) -> Html {
|
||||
let index = index.clone();
|
||||
wasm_bindgen_futures::spawn_local(async move {
|
||||
match delete_project(&project_id).await {
|
||||
Ok(_) => {force_update_handle.emit(index)},
|
||||
Err(error) => {log::error!("Error deleting project: {error}")}
|
||||
Ok(_) => force_update_handle.emit(index),
|
||||
Err(error) => {
|
||||
log::error!("Error deleting project: {error}")
|
||||
}
|
||||
};
|
||||
});
|
||||
is_attempting_delete.set(false);
|
||||
|
@ -24,7 +24,7 @@ pub fn admin_projects() -> Html {
|
||||
};
|
||||
});
|
||||
});
|
||||
|
||||
|
||||
html! {
|
||||
<>
|
||||
<AdminNavigationBar/>
|
||||
|
Loading…
Reference in New Issue
Block a user