MCPcopy Create free account
hub / github.com/MITK/MITK / HandlePOST_nodes_uid_children

Method HandlePOST_nodes_uid_children

Modules/RESTAPI/src/mitkDataStorageController.cpp:1450–1474  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1448}
1449
1450void DataStorageController::HandlePOST_nodes_uid_children(const httplib::Request& req, httplib::Response& res)
1451{
1452 if (!m_Bridge.HasDataStorage())
1453 {
1454 this->SendErrorResponse(res, 503, ErrorResponse::DataStorageNotAvailable(req.path));
1455 return;
1456 }
1457
1458 const std::string parentUid = req.path_params.at("uid");
1459 if (!ValidateUid(parentUid))
1460 {
1461 this->SendErrorResponse(res, 400, ErrorResponse::InvalidRequest("Invalid UID format", req.path));
1462 return;
1463 }
1464
1465 // Check if parent node exists
1466 auto parentNode = m_Bridge.GetNode(parentUid);
1467 if (!parentNode.has_value())
1468 {
1469 this->SendErrorResponse(res, 404, ErrorResponse::NodeNotFound(parentUid, req.path));
1470 return;
1471 }
1472
1473 this->HandlePOST_nodes_uid_generic(req, res, parentUid);
1474}
1475
1476void DataStorageController::HandleGET_nodes_uid_data(const httplib::Request& req, httplib::Response& res)
1477{

Callers 5

CreateChildNodeMethod · 0.80
CreateTestChildNodeMethod · 0.80
BuildEndpointRegistryMethod · 0.80
RegisterRoutesMethod · 0.80

Calls 6

SendErrorResponseMethod · 0.95
ValidateUidFunction · 0.85
atMethod · 0.80
HasDataStorageMethod · 0.45
GetNodeMethod · 0.45

Tested by 4

CreateChildNodeMethod · 0.64
CreateTestChildNodeMethod · 0.64
BuildEndpointRegistryMethod · 0.64