generated from hack4impact-calpoly/nextjs-app-template
-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Description
Description
Create an Event Mongoose schema to support event card data in ../src/database/models, and update/create API endpoints for accessing the event data.
Acceptance Criteria
The Event schema should include the following fields:
name, dayOfWeek, date, startTime, endTime, programId, eventId (in addition to any existing fields).
Create API endpoints for:
- Retrieving all Events
- Retrieving a specific Event by id
- Creating a new Event (POST)
Steps:
- Update the Event schema file in
../src/database/models - Add fields (name, dayOfWeek, date, startTime, endTime, programId, eventId) to the Event schema
- Create "event" API folder under
../src/app/api(ignore if already created) - Update/Create
route.tsin../src/app/api/event - Retrieve all Events (
../api/event) GET - Update/Create second
route.tsin../src/app/api/event/[eventId] - Retrieve a single Event (
../api/event/[eventId]) GET - Create a new Event (
../api/event) POST
Reactions are currently unavailable