Skip to content

Commit 8c0bd18

Browse files
committed
web/builds: build_trigger_rebuild_handler: return StatusCode::CREATED
1 parent b00d88b commit 8c0bd18

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/web/builds.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ use axum_extra::{
2525
TypedHeader,
2626
};
2727
use chrono::{DateTime, Utc};
28+
use http::StatusCode;
2829
use semver::Version;
2930
use serde::Serialize;
3031
use serde_json::json;
@@ -196,7 +197,7 @@ pub(crate) async fn build_trigger_rebuild_handler(
196197
.await
197198
.map_err(|e| JsonAxumNope(e.into()))?;
198199

199-
Ok(Json(json!({})))
200+
Ok((StatusCode::CREATED, Json(json!({}))))
200201
}
201202

202203
async fn get_builds(
@@ -442,7 +443,7 @@ mod tests {
442443
.post("/crate/foo/0.1.0/rebuild")
443444
.bearer_auth(correct_token)
444445
.send()?;
445-
assert_eq!(response.status(), StatusCode::OK);
446+
assert_eq!(response.status(), StatusCode::CREATED);
446447
let text = response.text()?;
447448
let json: serde_json::Value = serde_json::from_str(&text)?;
448449
assert_eq!(json, serde_json::json!({}));

0 commit comments

Comments
 (0)