From 3f95cc92fefa4109e4a08cb800dc06224b43afcb Mon Sep 17 00:00:00 2001
From: Angelina Su <77803745+angelinasu57@users.noreply.github.com>
Date: Thu, 30 Mar 2023 14:26:21 -0400
Subject: [PATCH] Finish creating viewForum component HTML to show form
responses. (#17)
* Finish creating viewForum component HTML with Response, First and Last name, and date for each form response.
* Add in Last Name in the table to keep track of the responses, as per suggestion.
* Adjusted endpoints and remove comments.
---
.../src/app/makeforum/makeforum.component.html | 17 -----------------
frontend/src/app/post.service.ts | 4 ++--
.../src/app/viewforum/viewforum.component.html | 2 +-
3 files changed, 3 insertions(+), 20 deletions(-)
diff --git a/frontend/src/app/makeforum/makeforum.component.html b/frontend/src/app/makeforum/makeforum.component.html
index c1dd101..a4f88dd 100644
--- a/frontend/src/app/makeforum/makeforum.component.html
+++ b/frontend/src/app/makeforum/makeforum.component.html
@@ -9,21 +9,4 @@
Make a Forum Post With Resources!!
-
diff --git a/frontend/src/app/post.service.ts b/frontend/src/app/post.service.ts
index 4acfb63..6e5b42c 100644
--- a/frontend/src/app/post.service.ts
+++ b/frontend/src/app/post.service.ts
@@ -41,12 +41,12 @@ export class PostService {
// })
// )
// return new_table
- return this.http.get("/api/forum");
+ return this.http.get("/api/posts");
}
makePost(id: number, content: string, user: Profile, votes: [], timestamp: Date): Observable {
let post: Post = {id, content, user, votes, timestamp};
- return this.http.post("/api/forum/", post);
+ return this.http.post("/api/posts/", post);
}
// deletePost(id: number) {
diff --git a/frontend/src/app/viewforum/viewforum.component.html b/frontend/src/app/viewforum/viewforum.component.html
index 7aa51d1..384e174 100644
--- a/frontend/src/app/viewforum/viewforum.component.html
+++ b/frontend/src/app/viewforum/viewforum.component.html
@@ -11,7 +11,7 @@
{{ post.content }} |
{{ post.user.first_name}} |
- {{ post.user.last_name }} |
+ {{ post.user.last_name}} |
{{ post.timestamp | date:'YYYY/MM/dd @ hh:MMaa' }} |