Fix: missing upstream in From
This commit is contained in:
@@ -70,7 +70,13 @@ impl From<crate::services::nginx::info::upstream_target::UpstreamTargetInfo>
|
|||||||
updated_at: info.updated_at,
|
updated_at: info.updated_at,
|
||||||
//
|
//
|
||||||
upstream_id: info.upstream_id,
|
upstream_id: info.upstream_id,
|
||||||
upstream: None,
|
upstream: info.upstream.map(|u| UpstreamBasicInfo {
|
||||||
|
id: u.id,
|
||||||
|
name: u.name,
|
||||||
|
protocol: u.protocol,
|
||||||
|
created_at: u.created_at,
|
||||||
|
updated_at: u.updated_at,
|
||||||
|
}),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -165,7 +171,6 @@ mod tests {
|
|||||||
let res = server.get(&url).await;
|
let res = server.get(&url).await;
|
||||||
res.assert_status_ok();
|
res.assert_status_ok();
|
||||||
let text = res.text();
|
let text = res.text();
|
||||||
println!("response body: {}", text);
|
|
||||||
let body: UpstreamTargetInfo = serde_json::from_str(&text).expect("failed to parse json");
|
let body: UpstreamTargetInfo = serde_json::from_str(&text).expect("failed to parse json");
|
||||||
assert_eq!(body.upstream_id, up_id);
|
assert_eq!(body.upstream_id, up_id);
|
||||||
assert!(body.upstream.is_some());
|
assert!(body.upstream.is_some());
|
||||||
|
|||||||
Reference in New Issue
Block a user