boolean-uk / team-dev-server

3 stars 12 forks source link

#29 As a user, so I can find out more about other teachers and students, I want to be able to view profile information #210

Open JohnXander opened 2 years ago

JohnXander commented 2 years ago

Tasks

Backend

Auenc commented 2 years ago

Frontend

Create profile page that can be linked to elsewhere. The profile page will be populated with the users: profile pic, first name, last name, github url. Styling should match styling used throughout the app.

Before we sign this off, it would be a good idea to do the following:

Backend

Profile page information will be populated by information obtained from the users profile on the database using a GET request, i.e.(/user/1/profile), will use userId: 1 to find the correct users profile information and pass it on to the frontend to populate the fields.

It would be a good idea to attach a snippet of JSON to show what this user data would look like.

Frontend

Once the post team has created post functionality we can add a link to the post author's name which will link to the users profile page using the same (/user/1/profile) GET request as above.

This looks good, it just needs to be added to the team-dev-client repo as an issue.

Frontend

Add "my profile link" (styled matching that throughout the app) to the header that links to your own profile. Similar link should > be on each of your own posts attached to your own name on the post.

Can you add what the URL for a users own profile will be? For instance, it could be the same path as other users profile (but with the currently logged in users id) or it could be something like /my-profile. Adding the URL you want it to be in will avoid any ambiguity when someone comes to do the work.

Backend

Posts will follow the above, a post should have that users information that be used to reach the correct users profile. The "my > profile link" will be added to the header upon login, once logged in the current users information will be available from logging > in with their token, the token should include the users id which can be used to create the GET request for the link to reach their own profile.

It would be a good idea to include a snippet of example JSON data for the a post. That way, when someone comes to doing the work, they have an example data to show what the API endpoint should be responding.

JohnXander commented 2 years ago

The URL for the page will be /profile/:id

Snippet of JSON of user data: { "first_name": "Nathan", "last_name": "King", "biography": "Hello world", "github_url": "https://github.com/vherus" }

JohnXander commented 2 years ago

Snippet of JSON of the post data: "content": "Hello!", "userId": 1

Auenc commented 2 years ago

Could you edit the original message in the issue? That way the snippets/urls are next to the relevant information :)

JohnXander commented 2 years ago

Done 👍

Auenc commented 2 years ago

Can you wrap the snippets in code blocks please?

You can do that with 3 back ticks ``` { "something": 5 } ```