Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

removed user email from post details page #47 #77

Merged
merged 3 commits into from
Jun 3, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions backend/src/routes/post/controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,6 @@ export const getPostController = async (req: Request, res: Response) => {
select: {
id: true,
username: true,
email: true,
},
},
},
Expand Down Expand Up @@ -167,7 +166,6 @@ export const getPostsWithPagination = async (req: Request, res: Response) => {
select: {
id: true,
username: true,
email: true,
},
},
},
Expand Down
6 changes: 5 additions & 1 deletion frontend/src/pages/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,11 @@ const Post = () => {
<div className="p-6 text-white max-w-screen-xl mx-auto">
{post && (
<>
<button onClick={() => window.history.back()} className="mb-4 px-2 py-1 bg-blue-600 hover:bg-blue-700 text-white text-sm rounded">
<svg xmlns="http://www.w3.org/2000/svg" className="h-4 w-4 inline-block" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path strokeLinecap="round" strokeLinejoin="round" strokeWidth={2} d="M10 19l-7-7m0 0l7-7m-7 7h18" />
</svg>
</button>
<h2 className="text-2xl font-semibold mb-4">{post.title}</h2>
<p className="mb-4">{post.description}</p>
<div className="relative mb-4">
Expand Down Expand Up @@ -157,7 +162,6 @@ const Post = () => {
<div className="mb-4">
<h3 className="text-xl font-semibold mb-2">Author</h3>
<p>Username: {post.author.username}</p>
<p>Email: {post.author.email}</p>
</div>
</>
)}
Expand Down
Loading