Skip to content

Frontend/storedashboard#52

Merged
CDevmina merged 3 commits intoDevelopmentfrom
frontend/storedashboard
Apr 24, 2025
Merged

Frontend/storedashboard#52
CDevmina merged 3 commits intoDevelopmentfrom
frontend/storedashboard

Conversation

@CDevmina
Copy link
Owner

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:

    • Added a GET /stores/api-usage-log endpoint 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)
    • Defined new schemas ApiUsageLogEntry and PaginationInfo in the OpenAPI specification for the response structure. (api-service/api/openapi.yaml, api-service/api/openapi.yamlR1653-R1697)
  • Controller and Service Implementation:

Frontend Changes

  • Types and API Client Updates:

    • Added new types ApiUsageLogEntry, PaginationInfo, and GetApiUsageLogParams to represent the API response and query parameters. (web/src/api/types/data-contracts.ts, [1] [2]
    • Updated the Stores API client to include a getApiUsageLog method for the new endpoint. (web/src/api/types/Stores.ts, web/src/api/types/Stores.tsR215-R248)
  • React Query Integration:

    • Added a new hook useApiUsageLog to 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)
    • Updated cache keys to include support for the new API usage log queries. (web/src/api/utils/cache.ts, [1] [2]
  • Codebase Refactoring:

    • Moved several dashboard-related components to a StoreDashboard folder for better organization. (web/src/main.tsx, [1] [2]
    • Removed the placeholder StoreDashboard component, 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.

- 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
@CDevmina CDevmina self-assigned this Apr 24, 2025
@CDevmina CDevmina merged commit b7fbdf9 into Development Apr 24, 2025
3 of 8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant