mirror of
https://git.rwth-aachen.de/acs/public/villas/node/
synced 2025-03-09 00:00:00 +01:00
api: provide node output signals
This commit is contained in:
parent
9b9f880d18
commit
c0bbcd910b
1 changed files with 10 additions and 1 deletions
|
@ -48,7 +48,16 @@ public:
|
|||
if (body != nullptr)
|
||||
throw BadRequest("Nodes endpoint does not accept any body data");
|
||||
|
||||
return new JsonResponse(session, HTTP_STATUS_OK, node->toJson());
|
||||
auto *json_node = node->toJson();
|
||||
|
||||
auto sigs = node->getOutputSignals();
|
||||
if (sigs) {
|
||||
auto *json_out = json_object_get(json_node, "out");
|
||||
if (json_out)
|
||||
json_object_set_new(json_out, "signals", sigs->toJson());
|
||||
}
|
||||
|
||||
return new JsonResponse(session, HTTP_STATUS_OK, json_node);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue