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

Create Article Backend Route #8

Closed
mraysu opened this issue Jan 7, 2025 · 0 comments · Fixed by #22
Closed

Create Article Backend Route #8

mraysu opened this issue Jan 7, 2025 · 0 comments · Fixed by #22
Assignees
Labels

Comments

@mraysu
Copy link
Collaborator

mraysu commented Jan 7, 2025

We want to have a route for creating and editing news/event articles. These articles will appear in the News and Events section, and will serve as records of HoMEwork activity.

For your PR:

Create a schema for an article type on the backend (like this one)

  1. header (title)
  2. dateCreated
  3. author
  4. body (contents of the article, optional)
  5. thumbnail (optional string, should be a file url to an image. We will implement this with our image uploading feature)

Perform validation on all fields using express validator.

Create the following backend routes:

  1. POST api/articles/create
    a. Create a new article in our database
  2. GET api/articles/all
    a. Request an object containing all articles in our database.
  3. PUT api/articles/:id
    a. Update the fields of a specific article

Do not worry about auth token validation for these routes, we will implement that with the frontend form.

For testing, show each of these routes working on curl/postman. Show that the backend will reject invalid request bodies (empty/missing fields, improperly formatted date, etc)

@mraysu mraysu added the task label Jan 7, 2025
@mraysu mraysu mentioned this issue Jan 7, 2025
5 tasks
@EdwardLinS EdwardLinS self-assigned this Jan 10, 2025
@EdwardLinS EdwardLinS linked a pull request Jan 15, 2025 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants