mirror of
https://github.com/C9Glax/tranga.git
synced 2025-02-23 15:50:13 +01:00
API added POST
NotificationConnectors/Reset LibraryConnectors/Reset
This commit is contained in:
parent
1cce0f204e
commit
db53e2156b
@ -528,6 +528,16 @@ public class Server : GlobalBase
|
|||||||
notificationConnector.SendNotification("Tranga Test", "This is Test-Notification.");
|
notificationConnector.SendNotification("Tranga Test", "This is Test-Notification.");
|
||||||
SendResponse(HttpStatusCode.Accepted, response);
|
SendResponse(HttpStatusCode.Accepted, response);
|
||||||
break;
|
break;
|
||||||
|
case "NotificationConnectors/Reset":
|
||||||
|
if (!requestVariables.TryGetValue("notificationConnector", out notificationConnectorStr) ||
|
||||||
|
!Enum.TryParse(notificationConnectorStr, out notificationConnectorType))
|
||||||
|
{
|
||||||
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
DeleteNotificationConnector(notificationConnectorType);
|
||||||
|
SendResponse(HttpStatusCode.Accepted, response);
|
||||||
|
break;
|
||||||
case "LibraryConnectors/Update":
|
case "LibraryConnectors/Update":
|
||||||
if (!requestVariables.TryGetValue("libraryConnector", out libraryConnectorStr) ||
|
if (!requestVariables.TryGetValue("libraryConnector", out libraryConnectorStr) ||
|
||||||
!Enum.TryParse(libraryConnectorStr, out libraryConnectorType))
|
!Enum.TryParse(libraryConnectorStr, out libraryConnectorType))
|
||||||
@ -600,6 +610,16 @@ public class Server : GlobalBase
|
|||||||
libraryConnector.UpdateLibrary();
|
libraryConnector.UpdateLibrary();
|
||||||
SendResponse(HttpStatusCode.Accepted, response);
|
SendResponse(HttpStatusCode.Accepted, response);
|
||||||
break;
|
break;
|
||||||
|
case "LibraryConnectors/Reset":
|
||||||
|
if (!requestVariables.TryGetValue("libraryConnector", out libraryConnectorStr) ||
|
||||||
|
!Enum.TryParse(libraryConnectorStr, out libraryConnectorType))
|
||||||
|
{
|
||||||
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
DeleteLibraryConnector(libraryConnectorType);
|
||||||
|
SendResponse(HttpStatusCode.Accepted, response);
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
SendResponse(HttpStatusCode.BadRequest, response);
|
SendResponse(HttpStatusCode.BadRequest, response);
|
||||||
break;
|
break;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user