Implement follow redirect on delete and update vm
This commit is contained in:
		
							parent
							
								
									a25c53d709
								
							
						
					
					
						commit
						ddc5d24857
					
				| @ -157,10 +157,9 @@ pub async fn list_contracts(req: ListVmContractsReq) -> Result<Vec<VmContract>, | ||||
| } | ||||
| 
 | ||||
| pub async fn delete_vm(uuid: &str) -> Result<(), Error> { | ||||
|     let mut client = client().await?; | ||||
|     let client = client().await?; | ||||
|     let req = DeleteVmReq { uuid: uuid.to_string(), admin_pubkey: Config::get_detee_wallet()? }; | ||||
|     let result = client.delete_vm(sign_request(req)?).await; | ||||
|     match result { | ||||
|     match call_with_follow_redirect!(client, req, delete_vm).await { | ||||
|         Ok(confirmation) => { | ||||
|             log::debug!("VM deletion confirmation: {confirmation:?}"); | ||||
|         } | ||||
| @ -195,9 +194,8 @@ pub async fn extend_vm(uuid: String, admin_pubkey: String, locked_nano: u64) -> | ||||
| 
 | ||||
| pub async fn update_vm(req: UpdateVmReq) -> Result<UpdateVmResp, Error> { | ||||
|     info!("Updating VM {req:?}"); | ||||
|     let mut client = client().await?; | ||||
|     let result = client.update_vm(sign_request(req)?).await; | ||||
|     match result { | ||||
|     let client = client().await?; | ||||
|     match call_with_follow_redirect!(client, req, update_vm).await { | ||||
|         Ok(resp) => { | ||||
|             let resp = resp.into_inner(); | ||||
|             if resp.error.is_empty() { | ||||
|  | ||||
		Loading…
	
		Reference in New Issue
	
	Block a user