SE701-T5 / Backend

Heroku deployed Node.js backend server developed by Team-5 for the UniForum project associated with the University of Auckland SOFTENG 701 course
https://uni-forum.herokuapp.com/
MIT License
2 stars 18 forks source link

Fix existing endpoints #100

Closed j-chad closed 2 years ago

j-chad commented 2 years ago

Is your feature request related to a problem? Please describe. The backend endpoints are currently not consistently working and do not provide the front end with sufficient information.

Describe the solution you'd like Add endpoints:

Verify functionality of the existing endpoints:

Additional context FE Issue

Checklist:

justcrossheaven commented 2 years ago

Update: For post endpoints, all users would have the ability to update/delete other user's post. (Not sure whether this should be fixed tho)

justcrossheaven commented 2 years ago
POST /api/v1/users : 
{
    "username":"john",
    "displayName":"lol",
    "email": "dev111@test.com",
    "plaintextPassword":"123456www"
}
POST /api/v1/users/login : 
{
    "username":"john",
    "plaintextPassword":"123456www"
}
POST /api/v1/posts
{
    "userID": "john's id",
    "communityID": "UOA",
    "title": "lol",
    "text": "lol",
    "images": ["image string"]
}
POST /api/v1/posts/:id/comments
{
    "authorID": "john's id",
    "username": "john",
    "title": "lol",
    "bodyText": "lol",
    "attachments": ["image"]
}
ljey973 commented 2 years ago

Endpoint for updating a comment has been changed from : PATCH /api/v1/posts/:id/comments/:id to: PATCH /api/v1/posts/comments/:id

justcrossheaven commented 2 years ago
POST /api/v1/communities
{
    "userID": "623efb5efc2d42cdd9456ba2",
    "name": "uoa",
    "description": "akjsdhaskjdhaskd",
    "members": 25,
    "img": "ashdksjah"
}
j-chad commented 2 years ago

the members shouldn't be part of the post request

j-chad commented 2 years ago

also why does it need userid?

justcrossheaven commented 2 years ago

also why does it need userid?

Should this endpoint be authenticated? If yes then it would need userID...

j-chad commented 2 years ago

that will be passed with the authentication header