Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Intake Statistical Form | CRUD + Schema + Connection #126

Open
3 of 5 tasks
benson-fm opened this issue Apr 3, 2025 · 0 comments
Open
3 of 5 tasks

Intake Statistical Form | CRUD + Schema + Connection #126

benson-fm opened this issue Apr 3, 2025 · 0 comments
Assignees

Comments

@benson-fm
Copy link
Collaborator

benson-fm commented Apr 3, 2025

Description

We need to fully integrate the Intake Statistical form into the application. This includes setting up the backend routes for the intakeStatsTable, making sure the frontend is wired to those routes, and ensuring the data flows smoothly through form creation and population.

Steps

1. Backend API Implementation

In intakeStatsForm.ts (backend):

  • Create CRUD endpoints for the intakeStatsTable:
    • GET /api/intakeStatsForm/:id → fetch a single statistical intake form
    • POST /api/intakeStatsForm → create a new form entry
  • Ensure the schema and controller logic are clean and match the data types used in the frontend.
  • Validate required fields and handle errors.

2. Frontend API Connection

In intakeStats.tsx:

  • Connect form submission logic to the correct POST backend route (/api/intakeStats).
  • Update the questions to match to the schema in intake_statistics_form.sql.
  • Ensure form validation and loading/error states are handled properly.
  • Reference the figma for structure, but in terms of the data inputs follow that to the schema

In formsTable.tsx:

  • Update the table logic to fetch and display entries from intakeStats.
    • Update the table data source to use the new GET route.
    • Ensure the table renders the correct fields from the figma (Checkbox, Date, Client Name, Export) - this may be already done as a component, so you may just want to update a specific line to ensure the logic is right in getting the data from the GET route.
  • Add functionality for export form.

Acceptance Criteria

  • All CRUD endpoints for intakeStatsTable are implemented and return correct data
  • intakeStats.tsx is connected to the POST route and handles responses
  • formsTable.tsx is updated to fetch and populate data from intakeStatsForm
  • Table renders correct form entries
  • Export Form Works
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

When branches are created from issues, their pull requests are automatically linked.

3 participants