| 1448 | } |
| 1449 | |
| 1450 | void 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 | |
| 1476 | void DataStorageController::HandleGET_nodes_uid_data(const httplib::Request& req, httplib::Response& res) |
| 1477 | { |