Skip to content

Feature/create faqs endpoint#104

Merged
james-cross merged 3 commits intoStreetSupport:stagingfrom
james-cross:feature/create-faqs-endpoint
Jun 18, 2025
Merged

Feature/create faqs endpoint#104
james-cross merged 3 commits intoStreetSupport:stagingfrom
james-cross:feature/create-faqs-endpoint

Conversation

@james-cross
Copy link
Collaborator

  • Added /api/faqs route with a dedicated getFaqs helper and full unit test.
  • Supports optional location query param to filter FAQs by LocationKey.
  • Created fetch-client-groups.js script to output client-groups.json from DB.
  • Refactored existing /api/categories and /api/locations routes:
    • Extracted DB logic to getCategories and getLocations helpers.
    • Added or updated unit tests for each helper with robust DB mocks.
    • Ensured proper TypeScript type safety by declaring collection generics.
  • Standardised pattern for API routes: minimal route.ts with reusable pure helper for easy test coverage.
  • Verified all helper unit tests pass and type check cleanly.

@james-cross james-cross merged commit a92032f into StreetSupport:staging Jun 18, 2025
4 checks passed
@james-cross james-cross deleted the feature/create-faqs-endpoint branch June 18, 2025 09:11
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