mirror of
https://github.com/aljazceru/btcpayserver.git
synced 2025-12-17 14:04:26 +01:00
Normalize greenfield responses for 404s (#3220)
This commit is contained in:
@@ -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");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user