Merged
Conversation
- Implement UserPreferencesPage for managing user interests and demographics. - Create UserProfilePage for updating user profile information and privacy settings. - Integrate form handling with react-hook-form for both pages. - Add loading and error handling components for better user experience. - Include delete account functionality with confirmation modal in UserProfilePage. - Utilize Flowbite components for UI consistency and responsiveness.
…anagement for improved loading and error handling
…ne user profile management
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new feature to retrieve and display API usage logs for stores, along with updates to support this functionality across the backend and frontend. The most important changes include adding a new API endpoint, implementing the backend logic to fetch and filter logs, and integrating the feature into the frontend with hooks and types.
Backend Changes
New API Endpoint for API Usage Logs:
GET /stores/api-usage-logendpoint to the OpenAPI specification, with support for filtering by API key ID, date range, and pagination. It returns a paginated list of logs and metadata. (api-service/api/openapi.yaml, api-service/api/openapi.yamlR536-R604)ApiUsageLogEntryandPaginationInfoin the OpenAPI specification for the response structure. (api-service/api/openapi.yaml, api-service/api/openapi.yamlR1653-R1697)Controller and Service Implementation:
getApiUsageLogmethod to theStoreManagementcontroller to handle requests for the new endpoint. (api-service/controllers/StoreManagement.js, api-service/controllers/StoreManagement.jsL42-R52)getApiUsageLogmethod inStoreManagementService.jsto query the database for logs, apply filters, and return paginated results. (api-service/service/StoreManagementService.js, api-service/service/StoreManagementService.jsR283-R368)Frontend Changes
Types and API Client Updates:
ApiUsageLogEntry,PaginationInfo, andGetApiUsageLogParamsto represent the API response and query parameters. (web/src/api/types/data-contracts.ts, [1] [2]StoresAPI client to include agetApiUsageLogmethod for the new endpoint. (web/src/api/types/Stores.ts, web/src/api/types/Stores.tsR215-R248)React Query Integration:
useApiUsageLogto fetch and cache API usage logs using React Query, with support for query parameters. (web/src/api/hooks/useStoreHooks.ts, web/src/api/hooks/useStoreHooks.tsL81-L96)web/src/api/utils/cache.ts, [1] [2]Codebase Refactoring:
StoreDashboardfolder for better organization. (web/src/main.tsx, [1] [2]StoreDashboardcomponent, which will be replaced with the new API management features. (web/src/pages/StoreDashboard.tsx, web/src/pages/StoreDashboard.tsxL1-L49)These changes collectively enable store owners to view detailed API usage logs, filter them by various criteria, and navigate through paginated results.