2
0

Changed return-values of API: NotifcationConnectors/Types and LibraryConnectors/Types

This commit is contained in:
glax 2023-08-31 15:41:29 +02:00
parent c0efbb22cc
commit d5d34c5381

View File

@ -171,14 +171,16 @@ public class Server : GlobalBase
case "NotificationConnectors": case "NotificationConnectors":
SendResponse(HttpStatusCode.OK, response, notificationConnectors); SendResponse(HttpStatusCode.OK, response, notificationConnectors);
break; break;
case "NotificationsConnectors/Types": case "NotificationConnectors/Types":
SendResponse(HttpStatusCode.OK, response, Enum.GetNames(typeof(NotificationConnector.NotificationManagerType))); SendResponse(HttpStatusCode.OK, response,
Enum.GetValues<NotificationConnector.NotificationManagerType>().Select(nc => new KeyValuePair<byte, string?>((byte)nc, Enum.GetName(nc))));
break; break;
case "LibraryConnectors": case "LibraryConnectors":
SendResponse(HttpStatusCode.OK, response, libraryConnectors); SendResponse(HttpStatusCode.OK, response, libraryConnectors);
break; break;
case "LibraryConnectors/Types": case "LibraryConnectors/Types":
SendResponse(HttpStatusCode.OK, response, Enum.GetNames(typeof(LibraryConnector.LibraryType))); SendResponse(HttpStatusCode.OK, response,
Enum.GetValues<LibraryConnector.LibraryType>().Select(lc => new KeyValuePair<byte, string?>((byte)lc, Enum.GetName(lc))));
break; break;
default: default:
SendResponse(HttpStatusCode.BadRequest, response); SendResponse(HttpStatusCode.BadRequest, response);