Skip to content

Commit dbbbb2a

Browse files
authored
Merge pull request #51 from techulus/develop
Github action to create changelog post now support post tags
2 parents ff09683 + 6fc1ebb commit dbbbb2a

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

apps/web/pages/api/integrations/github/action-new-post.tsx

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,17 @@ export default async function handler(
1212
res: NextApiResponse<Pick<IPost, "id"> | null | IErrorResponse>
1313
) {
1414
const {
15-
body: { title, type, content, status },
15+
body: { title, type, tags, content, status },
1616
} = req;
1717
const page_secret_key = req.headers["page-secret-key"];
1818

19-
if (!page_secret_key || !title || !type || !content || !status) {
19+
if (!page_secret_key || !title || !content || !status) {
20+
res
21+
.status(400)
22+
.json({ error: { statusCode: 400, message: "Invalid request" } });
23+
}
24+
25+
if (!tags && !type) {
2026
res
2127
.status(400)
2228
.json({ error: { statusCode: 400, message: "Invalid request" } });
@@ -34,7 +40,7 @@ export default async function handler(
3440
page_id: pageDetails.id,
3541
title,
3642
content,
37-
type,
43+
tags: tags ?? [type],
3844
status,
3945
images_folder: v4(),
4046
publication_date:

0 commit comments

Comments
 (0)