Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
chibat committed Jan 24, 2024
1 parent 538d455 commit 16028db
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 24 deletions.
15 changes: 3 additions & 12 deletions components/Post.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -69,18 +69,9 @@ export default function Post(props: { post: GetPostsOutput; userId?: number }) {
<div class="card-body">
{post.value.draft &&
(
<div
class="alert alert-danger d-flex align-items-center"
role="alert"
>
<span
class="badge bg-danger"
style={{ marginRight: "5px" }}
>
PRIVATE
</span>
<div>This post is visible only to you.</div>
</div>
<span class="badge bg-danger mb-2">
🔒 PRIVATE
</span>
)}
<span
class="post"
Expand Down
15 changes: 3 additions & 12 deletions islands/PostView.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -211,18 +211,9 @@ export default function PostView(
<article class="card-body">
{post.draft &&
(
<div
class="alert alert-danger d-flex align-items-center"
role="alert"
>
<span
class="badge bg-danger"
style={{ marginRight: "5px" }}
>
PRIVATE
</span>
<div>This post is visible only to you.</div>
</div>
<span class="badge bg-danger mb-2">
🔒 PRIVATE
</span>
)}
<section>
<span
Expand Down
3 changes: 3 additions & 0 deletions routes/posts/[postId]/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ import { getTitle } from "~/server/getTitle.ts";

export default defineRoute(async (req, ctx) => {
const postId = Number(ctx.params.postId);
if (Number.isNaN(postId)) {
return ctx.renderNotFound();
}
const post = await selectPost(postId);
if (!post) {
return ctx.renderNotFound();
Expand Down

0 comments on commit 16028db

Please sign in to comment.