Open gbowne1 opened 11 months ago
Can I get assigned? let me know how to start.
Hey! I am ready to work on this issue. I'll do the get request for others users profile pages and also update the user model to have likes on their page. Could you assign me this issue?
Ok @Joywin2412
I have worked on the issue. Do review it.
I forgot. In order to see the profile you have to go to: http://localhost:3000/profile/profile.html as going to http://localhost:3000/profile alone does not work.
@Joywin2412 @jzunigarce
Okay , do you want me to fetch the html file whenver someone does a get request on the given route /profile/profile.html just to be sure? @gbowne1
@Joywin2412 I think it should be /profile in the browser's address bar instead of the full URI/URL of /profile/profile.html even though the server sends the html file from the public folder.
This happens with dashboard too. In order to actually see the dashboard you have to navigate to /dashboard/dashboard.html as /dashboard alone won't work. Probably why we aren't redirecting to /dashboard after successful login. The redirecting path might need to be the full path not just /profile or /dashboard.
Okay then , I got it. I'll change the controllers code of profile. Whenver someone makes a get request to the /profile, the server will respond with profile.html file.
I also noticed that the only thing we have is the profile.controller.js
There's no service, middleware etc.
Yes , we don't have profile.html. Should I leave it or make a profile.html file?
There is a profile.html
It's in/profile/profile.html in the client side folder(s)
We also have profile.js in the scripts on the client side folder(s)
Okay got it
It will load if you navigate to http://localhost:3000/profile/profile.html. it won't work if you go to http://localhost:3000/profile
I have made the changes in the client side routing. I have also made some changes in server.js because of problems I had to face while running the server on my machine. Do review it @gbowne1
Any reviews you want make sure you add me to and @jzunigarce to the PRs as reviewers as we are both maintainers. I will review this.
Just so you know, Both the api v1 and the web api need the same changes.
A service and middleware for the profile will have to be created in their respective folders.
I didn't get the statement "A service and the middleware for the profile will have to be created". The issue is completed right or do I have make more changes?
Yes it's complete. I think it's fine the way it is and it works.
Typically as you see we have controller, middleware, router and a service for each of the functionality. We originally had a huge server.js file.
The API v1 and the Web API hasn't been documented yet.
Okay got it. Please do close this issue as completed 🚀
@Joywin2412 as far as the actual issue in this issue thread, now that the profile routes correctly, is to create a means of editing the profile if the user is logged in and has the correct permissions, etc.
In the dashboard and all of the other pages in the app like /scanlog, /vhflog, /hamlog, /mwlog you should be able to click on the user icon / avatar and click on the profile in the dropdown that appears and it should show the profile page.
Okay , I understood the underlying issue. I think I'll unassign myself and someone else take up the work. I am not sure how to solve the navigation of routes.
@Joywin2412 sorry for the confusion if there was any. You were able to get the profile routing correctly. That's great all by itself The profile itself needs some more work. We still need to document the APIs.
I added a new profile page to the app at /profile
There is currently no way for a logged in user to create, edit or otherwise update their profile
They should be able to CRUD any part of their profile and the new or updated information should be saved to the mongoose/mongodb database/ collection(s).
There should also be some method for users to see the other users profiles registered on the app and to like, follow, share, etc. those users.