This commit is contained in:
2020-07-24 21:16:36 +00:00
parent ea3bc198a0
commit ea32633c60
5 changed files with 36 additions and 4 deletions

View File

@@ -139,6 +139,30 @@ namespace AyaNova.Api.Controllers
return Ok(ApiOkResponse.Response(ret));
}
/// <summary>
/// Delete pending notification event
/// </summary>
/// <param name="id"></param>
/// <returns>NoContent</returns>
[HttpDelete("notify-event/{id}")]
public async Task<IActionResult> DeleteNotifyEvent([FromRoute] long id)
{
if (!serverState.IsOpen)
return StatusCode(503, new ApiErrorResponse(serverState.ApiErrorCode, null, serverState.Reason));
if (!ModelState.IsValid)
return BadRequest(new ApiErrorResponse(ModelState));
if (!Authorized.HasDeleteRole(HttpContext.Items, AyaType.OpsNotificationSettings))
{
return StatusCode(403, new ApiNotAuthorizedResponse());
}
var n = await ct.NotifyEvent.FirstOrDefaultAsync(z => z.Id == id);
if (n == null)
return BadRequest(new ApiErrorResponse(ApiErrorCode.NOT_FOUND, "id"));
ct.NotifyEvent.Remove(n);
await ct.SaveChangesAsync();
return NoContent();
}
//------------

View File

@@ -1902,5 +1902,7 @@
"ConnectionSecurity": "SMTP-Verbindungssicherheit",
"SmtpServerPort": "SMTP-Server-Port",
"NotifyFromAddress": "SMTP-Benachrichtigungsadresse",
"AyaNovaServerURL": "AyaNova Server URL"
"AyaNovaServerURL": "AyaNova Server URL",
"DeliverAfter":"Liefern nach",
"NotifyQueue":"Warteschlange für Benachrichtigungszustellung"
}

View File

@@ -1902,5 +1902,7 @@
"ConnectionSecurity": "SMTP connection security",
"SmtpServerPort": "SMTP server port",
"NotifyFromAddress": "SMTP notify from address",
"AyaNovaServerURL": "AyaNova server URL"
"AyaNovaServerURL": "AyaNova server URL",
"DeliverAfter":"Deliver after",
"NotifyQueue":"Notify event delivery queue"
}

View File

@@ -1902,5 +1902,7 @@
"ConnectionSecurity": "Seguridad de conexión del servidor SMTP",
"SmtpServerPort": "Puerto SMTP",
"NotifyFromAddress": "Notificación SMTP desde la dirección",
"AyaNovaServerURL": "URL del servidor AyaNova"
"AyaNovaServerURL": "URL del servidor AyaNova",
"DeliverAfter":"Entregar después",
"NotifyQueue":"Notificar cola de entrega de eventos"
}

View File

@@ -1902,5 +1902,7 @@
"ConnectionSecurity": "Sécurité de la connexion SMTP",
"SmtpServerPort": "Port du serveur SMTP",
"NotifyFromAddress": "Notification SMTP envoyée depuis l'adresse",
"AyaNovaServerURL": "URL du serveur AyaNova"
"AyaNovaServerURL": "URL du serveur AyaNova",
"DeliverAfter":"Livrer après",
"NotifyQueue":"Notifier file d'attente de remise des événements"
}