mirror of
https://github.com/johndoe6345789/metabuilder.git
synced 2026-04-24 13:54:57 +00:00
code: cpp,dbal,client (2 files)
This commit is contained in:
@@ -153,8 +153,10 @@ Result<std::vector<ComponentHierarchy>> Client::searchComponents(const std::stri
|
||||
return entities::component::search(getStore(), query, page_id, limit);
|
||||
}
|
||||
|
||||
Result<std::vector<ComponentHierarchy>> Client::getComponentChildren(const std::string& parent_id) {
|
||||
return entities::component::getChildren(getStore(), parent_id);
|
||||
Result<std::vector<ComponentHierarchy>> Client::getComponentChildren(const std::string& parent_id,
|
||||
const std::optional<std::string>& component_type,
|
||||
int limit) {
|
||||
return entities::component::getChildren(getStore(), parent_id, component_type, limit);
|
||||
}
|
||||
|
||||
Result<Workflow> Client::createWorkflow(const CreateWorkflowInput& input) {
|
||||
|
||||
@@ -923,6 +923,16 @@ void test_component_children() {
|
||||
assert(rootChildren.value()[0].id == childId);
|
||||
std::cout << " ✓ Retrieved direct children of root" << std::endl;
|
||||
|
||||
auto limitedChildren = client.getComponentChildren(rootId, "Child", 1);
|
||||
assert(limitedChildren.isOk());
|
||||
assert(limitedChildren.value().size() == 1);
|
||||
std::cout << " ✓ Component children limit works" << std::endl;
|
||||
|
||||
auto typeFilteredChildren = client.getComponentChildren(childId, "Grandchild", 5);
|
||||
assert(typeFilteredChildren.isOk());
|
||||
assert(typeFilteredChildren.value().size() == 1);
|
||||
std::cout << " ✓ Component children filter works" << std::endl;
|
||||
|
||||
auto childChildren = client.getComponentChildren(childId);
|
||||
assert(childChildren.isOk());
|
||||
assert(childChildren.value().size() == 1);
|
||||
|
||||
Reference in New Issue
Block a user