Pass Real Data to callGenerateReport in TaskQueueView

This commit updates the `TaskQueueView` to pass real data from the `selectedNodeHierarchy` to the `callGenerateReport` method in `SkillTreeViewModel`. An array of test names is constructed from the reversed node hierarchy, and these names are used as the `tests` field in the `ReportRequestBody`.

Note: The `category` field is now an empty string as per the new requirement, and `mock` continues to be set to true.
This commit is contained in:
hunteraraujo
2023-09-16 15:14:34 -07:00
parent 3e612e97de
commit d48eb99669

View File

@@ -13,6 +13,10 @@ class TaskQueueView extends StatelessWidget {
final reversedHierarchy =
viewModel.selectedNodeHierarchy?.reversed.toList() ?? [];
// Convert reversedHierarchy to a list of test names
final List<String> testNames =
reversedHierarchy.map((node) => node.data.name).toList();
return Material(
color: Colors.white,
child: Stack(
@@ -49,8 +53,8 @@ class TaskQueueView extends StatelessWidget {
onPressed: () {
// Create a ReportRequestBody with hardcoded values
ReportRequestBody reportRequestBody = ReportRequestBody(
category: "coding",
tests: [],
category: "",
tests: testNames,
mock: true,
);