Added files postdetailsviewmodel, postlistviewmodel, to viewmodels and details, edit, and myindex views to views/post
Modified postController & postRepo to have methods for getting index filtered by userId, deleting, and editing posts.
Updated post index to have links to edit and delete conditionally render based on userId
Steps to Review
Checkout this branch locally.
git fetch --all
git checkout mat-post-list
Open a new Terminal tab (?T) and navigate to the server directory.
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:
> 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
View code file.
Confirm file modifications are present as indicated above.
Confirm no unused code or extraneous comments exist.
Changes Made
Steps to Review
(#45 View All Posts)
(#44 View Current User's posts)
INSERT INTO UserProfile (DisplayName, FirstName, LastName, Email, CreateDateTime, UserTypeId) VALUES ('peter', 'Peter', 'Racine', 'peter@peter.com', SYSDATETIME(), 1)
(#41 Delete a post)
(#40 Edit a Post)