Skip to content

Frontend/storedashbaoard#51

Merged
CDevmina merged 10 commits intoDevelopmentfrom
frontend/storedashbaoard
Apr 24, 2025
Merged

Frontend/storedashbaoard#51
CDevmina merged 10 commits intoDevelopmentfrom
frontend/storedashbaoard

Conversation

@CDevmina
Copy link
Owner

This pull request introduces enhancements to the API and frontend, focusing on new features for filtering and searching user data and stores. It includes updates to the backend API, new query parameters for user data retrieval, and a new endpoint for store search. Corresponding frontend hooks and types are also updated to support these changes.

Backend Enhancements

API Updates:

  • Added optional query parameters (dataType, storeId, startDate, endDate, searchTerm) to the getRecentUserData endpoint for filtering and searching user data. Updated the response description and added a 404 error response. (api-service/api/openapi.yaml: [1] [2] [3]
  • Introduced a new GET /stores/search endpoint to search for stores by name, supporting query parameters like query and limit. (api-service/api/openapi.yaml: api-service/api/openapi.yamlR755-R794)

Service Layer:

  • Enhanced getRecentUserData in UserProfileService to dynamically build MongoDB queries based on the new filtering parameters. Added validation for storeId and date formats. (api-service/service/UserProfileService.js: [1] [2]
  • Added searchStores in StoreProfileService to handle store search queries using regex and optional text indexing for performance. (api-service/service/StoreProfileService.js: api-service/service/StoreProfileService.jsR169-R205)

Controllers:


Frontend Enhancements

Hooks:

Types and Utilities:

  • Extended GetRecentUserDataParams and introduced SearchStoresParams to define the new query parameters for user data and store search. (web/src/api/types/data-contracts.ts: [1] [2]
  • Added a searchStores method to the Stores class for interacting with the new store search endpoint. (web/src/api/types/Stores.ts: web/src/api/types/Stores.tsR233-R254)

Cache:

These changes collectively enhance the application's capabilities for filtering and searching, improving the user experience and making the API more versatile.

CDevmina added 10 commits April 23, 2025 22:49
…tering options

- Updated `/users/data/recent` endpoint to return a paginated list of user activity, including data submissions and usage.
- Added query parameters for filtering by date range, data type, store ID, and search term.
- Modified response structure to include pagination details.
- Introduced new `/stores` endpoint for listing and searching stores with pagination.
- Updated related service and controller methods to handle new parameters and logic.
- Adjusted TypeScript types to reflect changes in API responses and request parameters.
- Implemented search functionality for stores in UserDataSharingPage.
- Added loading and error handling for store search results.
- Improved UI for displaying opt-in and opt-out stores with conditional rendering.
- Refactored UserPreferencesPage to include a modal for adding/editing interests.
- Enhanced user experience with loading spinners and error alerts in both pages.
- Updated form handling for user demographics and preferences with better state management.
@CDevmina CDevmina added the enhancement New feature or request label Apr 24, 2025
@CDevmina CDevmina self-assigned this Apr 24, 2025
@CDevmina CDevmina merged commit 708bdc8 into Development Apr 24, 2025
3 of 7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant