Skip to content

Commit 40f417f

Browse files
committed
add update deployment
1 parent a33f955 commit 40f417f

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,25 @@
1+
use anyhow::Result;
2+
use reqwest::Client;
3+
use smbcloud_model::{
4+
error_codes::ErrorResponse,
5+
project::{Deployment, DeploymentPayload},
6+
};
7+
use smbcloud_networking::{environment::Environment, network::request};
8+
9+
use crate::build_project_deployment;
10+
11+
pub async fn update(
12+
env: Environment,
13+
access_token: String,
14+
project_id: i32,
15+
deployment_id: i32,
16+
status: DeploymentPayload,
17+
) -> Result<Deployment, ErrorResponse> {
18+
let url = build_project_deployment(env, project_id.to_string(), deployment_id.to_string());
19+
let builder = Client::new()
20+
.put(url)
21+
.json(&status)
22+
.header("Authorization", access_token);
23+
request(builder).await
24+
}
125

0 commit comments

Comments
 (0)