Normalize greenfield responses for 404s (#3220)

This commit is contained in:
Andrew Camilleri
2021-12-23 05:32:08 +01:00
committed by GitHub
parent ae33fc3031
commit 5f5f71bf37
10 changed files with 49 additions and 70 deletions

View File

@@ -55,7 +55,7 @@ namespace BTCPayServer.Controllers.GreenField
if (items.Count == 0)
{
return NotFound();
return NotificationNotFound();
}
return Ok(ToModel(items.Items.First()));
@@ -71,7 +71,7 @@ namespace BTCPayServer.Controllers.GreenField
if (items.Count == 0)
{
return NotFound();
return NotificationNotFound();
}
return Ok(ToModel(items.First()));
@@ -101,5 +101,9 @@ namespace BTCPayServer.Controllers.GreenField
Link = string.IsNullOrEmpty(entity.ActionLink) ? null : new Uri(entity.ActionLink)
};
}
private IActionResult NotificationNotFound()
{
return this.CreateAPIError(404, "notification-not-found", "The notification was not found");
}
}
}