Skip to content

Commit 1ad5b40

Browse files
authored
Merge pull request #37 from techulus/develop
Fix creating post with custom date
2 parents d55789f + 79cab51 commit 1ad5b40

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

apps/web/components/entity/empty-state.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,11 @@ export const NewPageOnboarding = ({
123123

124124
return (
125125
<div className="max-w-lg mx-auto px-4 py-16 md:py-28">
126-
<h2 className="text-lg font-medium text-gray-900 dark:text-gray-100">
126+
<h2 className="text-xl font-semibold text-gray-900 dark:text-gray-100">
127127
Welcome to your new page
128128
</h2>
129129
<p className="mt-1 text-sm text-gray-500 dark:text-gray-400">
130-
Get started by setting up your page or write your first post.
130+
Get started by setting up your page.
131131
</p>
132132
<ul
133133
role="list"

apps/web/pages/api/posts/index.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ const createNewPost = async (req: NextApiRequest, res: NextApiResponse) => {
1616
publish_at,
1717
notes,
1818
allow_reactions,
19+
publication_date,
1920
} = req.body;
2021

2122
try {
@@ -42,7 +43,8 @@ const createNewPost = async (req: NextApiRequest, res: NextApiResponse) => {
4243
images_folder,
4344
publish_at,
4445
publication_date:
45-
status === PostStatus.published ? new Date().toISOString() : null,
46+
publication_date ??
47+
(status === PostStatus.published ? new Date().toISOString() : null),
4648
notes: notes ?? "",
4749
allow_reactions: allow_reactions ?? false,
4850
});

0 commit comments

Comments
 (0)