Can delete a single account
This commit is contained in:
		@@ -39,3 +39,10 @@ pub async fn get_list(auth: AuthExtractor) -> HttpResult {
 | 
				
			|||||||
pub async fn get_single(account: AccountInPath) -> HttpResult {
 | 
					pub async fn get_single(account: AccountInPath) -> HttpResult {
 | 
				
			||||||
    Ok(HttpResponse::Ok().json(account.as_ref()))
 | 
					    Ok(HttpResponse::Ok().json(account.as_ref()))
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					/// Delete an account
 | 
				
			||||||
 | 
					pub async fn delete(account: AccountInPath) -> HttpResult {
 | 
				
			||||||
 | 
					    accounts_service::delete(account.as_ref().id()).await?;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    Ok(HttpResponse::Accepted().finish())
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -108,11 +108,10 @@ async fn main() -> std::io::Result<()> {
 | 
				
			|||||||
                web::get().to(accounts_controller::get_single),
 | 
					                web::get().to(accounts_controller::get_single),
 | 
				
			||||||
            )
 | 
					            )
 | 
				
			||||||
            // TODO : update account
 | 
					            // TODO : update account
 | 
				
			||||||
            //TODO
 | 
					            .route(
 | 
				
			||||||
            /*.route(
 | 
					                "/api/account/{account_id}",
 | 
				
			||||||
                "/api/accounts/{account_id}",
 | 
					 | 
				
			||||||
                web::delete().to(accounts_controller::delete),
 | 
					                web::delete().to(accounts_controller::delete),
 | 
				
			||||||
            )*/
 | 
					            )
 | 
				
			||||||
            // TODO : set as default
 | 
					            // TODO : set as default
 | 
				
			||||||
            // Static assets
 | 
					            // Static assets
 | 
				
			||||||
            .route("/", web::get().to(static_controller::root_index))
 | 
					            .route("/", web::get().to(static_controller::root_index))
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user