Commit Graph

4 Commits

Author SHA1 Message Date
hunteraraujo
7966b81e96 Update ViewModel classes for Chat and Task to handle structured responses
This commit updates the ViewModel classes for both Chat and Task to accommodate the new structured responses received from the API. These changes are essential for the correct functioning of the application as they deal with the new TaskResponse and Step objects.

Updates in ChatViewModel:
- Modified `fetchChatsForTask` to handle structured step data
- Updated how steps are retrieved and processed

Updates in TaskViewModel:
- Updated `fetchTasks` to use the new TaskResponse object
- Refactored task fetching and selection logic

These updates ensure that the ViewModel classes are aligned with the new structured API responses, improving data handling and UI updates.
2023-09-02 15:42:54 -07:00
hunteraraujo
5ae17d009b Update TaskViewModel to Use TaskService and Task API Integration
This commit includes a significant overhaul of the TaskViewModel to use the newly created TaskService and integrate it with the task API. Specifically:

- Removed dependency on mock data for tasks.
- Added real API calls through the TaskService for task operations like creating and fetching tasks.
- Updated createTask to return the ID of the newly created task.
- Updated fetchTasks method to fetch tasks from the API and update the local list.
- Updated selectTask to handle selection based on string IDs.

These changes make the TaskViewModel ready for real-world usage and remove dependencies on mock data.
2023-08-31 15:15:24 -07:00
hunteraraujo
5b520eb5ae Implement TaskViewModel with tests and mock data
This commit introduces the TaskViewModel, which manages the business logic for tasks. The ViewModel interacts with a mock data source, providing functionalities like fetching tasks, selecting a task, creating, and deleting tasks.

Additionally, comprehensive tests for TaskViewModel have been added to ensure its behavior aligns with expectations. The mock data source has also been updated to support the new functionalities.

Key Features:
- Task management in TaskViewModel.
- Tests for each major functionality in TaskViewModel.
- Mock data source to simulate data interactions.
2023-08-21 00:03:39 +02:00
hunteraraujo
d505724e90 Update agent to task 2023-08-20 19:20:56 +02:00