NSS-Day-Cohort-49 / tabloid-mvc-cassettes

tabloid-mvc-tabloid-mvc-cassettes created by GitHub Classroom
0 stars 1 forks source link

Mat post list #49

Closed mtrevin93 closed 2 years ago

mtrevin93 commented 2 years ago

Changes Made

  1. Added files postdetailsviewmodel, postlistviewmodel, to viewmodels and details, edit, and myindex views to views/post
  2. Modified postController & postRepo to have methods for getting index filtered by userId, deleting, and editing posts.
  3. Updated post index to have links to edit and delete conditionally render based on userId

Steps to Review

  1. Checkout this branch locally.
    git fetch --all
    git checkout mat-post-list
  2. Open a new Terminal tab (?T) and navigate to the server directory.
  3. Test app functionality.

(#45 View All Posts)

> Login to app with authenticated user, you should be able to see MyPosts and Posts views.
> Navigate to posts. You should see a list page with each post displaying title, author, and category of approved posts with publication dates in the past, sorted so most recent is on top 

(#44 View Current User's posts)

> Run the following SQL Script to create a new user: 

INSERT INTO UserProfile (DisplayName, FirstName, LastName, Email, CreateDateTime, UserTypeId) VALUES ('peter', 'Peter', 'Racine', 'peter@peter.com', SYSDATETIME(), 1)

> Create posts so that you have at least one post by each user. Check to see that Post list conditionally renders delete and edit buttons based on logged in user.
> Navigate to MyPosts. A list of posts by the logged in user, displaying title, author, and category, sorted by most recent creation date on top, should appear 

(#41 Delete a post)

Navigate to details page of a post written by the logged in user. A delete icon should be visible. Clicking this icon should bring up a dialogue. Only if confirmed, the post should be deleted and the author should be directed back to the post lsit. This should work from postlist and mypostlist (redirecting to list)

(#40 Edit a Post)

From the details page, postlist, or mypostlist of a post a user has written, an edit icon should be visible. Clicking this icon should direct to a form that auto-populates with the post's current details. Editing fields and clicking save should save to the database and redirect to post detail page. Clicking the cancel button should return the user to the List view. Edit page shows CategoryID rather than category name, which will be resolved after a dependency issue

  1. View code file.

    Confirm file modifications are present as indicated above. Confirm no unused code or extraneous comments exist.

hcrudge commented 2 years ago

Looks great!! Well done!