Skip to content

Language Table CRUD Routes and Endpoints For Case-language and clinic-language Join Tables #25

@dlacuata

Description

@dlacuata

Description

The task is to create CRUD (Create, Read, Update, Delete) API routes for the Language table and implement endpoints for managing the many-to-many relationships between languages and other entities through their respective intermediary tables:

Language table

  • POST /languages - create a language
  • GET /languages - get all languages
  • GET /languages/{id} - get a single language
  • PUT /languages/{id} - update a single language
  • DELETE /languages/{id} - delete a single language

Case-Language relationship

  • POST /cases/{caseId}/languages - assign a language to a case
  • DELETE /cases/{caseId}/languages/{languageId} - remove a language from a case
  • GET /cases/{caseId}/languages - list all languages for a case

Clinic-Language relationship

  • POST /clinics/{clinicId}/languages - assign a language to a clinic
  • DELETE /clinics/{clinicId}/languages/{languageId} - remove a language from a clinic
  • GET /clinics/{clinicId}/languages - list all languages for a clinic

Recommended Steps

  • Git pull to fetch current changes and create a new branch.
  • Review the Language table schema and all intermediary join tables.
  • Create languages.js file in /server/routes.
  • Implement CRUD routes for the Language table (Create, Read, Update, Delete).
  • Implement nested routes for managing all Language relationships (assign, remove, list) for Case, Clinic, Workshop, and Volunteer.
  • Implement validation and error handling for all routes.
  • Test all routes thoroughly using Postman and take screenshots as proof of functionality.

Acceptance Criteria

  • GET routes return all languages or a single record by ID.
  • POST route creates a new language in the database.
  • PUT route updates an existing language record.
  • DELETE route removes the correct language from the database.
  • POST routes assign a language to Case or Clinic entities correctly.
  • DELETE routes remove a language from Case or Clinic entities correctly.
  • GET routes list all languages associated with a specific Case or Clinic
  • Error handling is implemented for all routes.

Resources

  • See users.ts or other entity routes for structure reference.
  • Postman for testing requests.

If you have any questions, feel free to reach out to Josh or Dommenick on Slack!

Metadata

Metadata

Labels

No labels
No labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions