Updates from code review

Thanks @kukks!
This commit is contained in:
Dennis Reimann
2020-04-21 16:43:14 +02:00
parent 70d1056d48
commit 22e39998e2
3 changed files with 6 additions and 3 deletions

View File

@@ -9,7 +9,7 @@ namespace BTCPayServer.Client
{ {
public virtual async Task<ApiHealthData> GetHealth(CancellationToken token = default) public virtual async Task<ApiHealthData> GetHealth(CancellationToken token = default)
{ {
var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/health", bodyPayload: new {}), token); var response = await _httpClient.SendAsync(CreateHttpRequest("api/v1/health"), token);
return await HandleResponse<ApiHealthData>(response); return await HandleResponse<ApiHealthData>(response);
} }
} }

View File

@@ -12,7 +12,10 @@ namespace BTCPayServer.Controllers.GreenField
[HttpGet("~/api/v1/health")] [HttpGet("~/api/v1/health")]
public ActionResult GetHealth(NBXplorerDashboard dashBoard) public ActionResult GetHealth(NBXplorerDashboard dashBoard)
{ {
ApiHealthData model = new ApiHealthData() {Synchronized = dashBoard.IsFullySynched()}; ApiHealthData model = new ApiHealthData()
{
Synchronized = dashBoard.IsFullySynched()
};
return Ok(model); return Ok(model);
} }
} }

View File

@@ -32,7 +32,7 @@
"properties": { "properties": {
"synchronized": { "synchronized": {
"type": "boolean", "type": "boolean",
"description": "True if the instance is fully synchronized" "description": "True if the instance is fully synchronized, according to NBXplorer"
} }
} }
} }