Skip to content

Commit

Permalink
๐Ÿ› write api ๋ฒ„๊ทธ ์ˆ˜์ •
Browse files Browse the repository at this point in the history
  • Loading branch information
tmdrb278 committed May 17, 2023
1 parent 0f4eac9 commit 096110f
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions pages/api/post/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,12 @@ export default async function handler(req: NextApiRequest, res: NextApiResponse)
}

const newPost = await createPost(title, content, author.id, thumbnail);
res.status(200).json(newPost);
return res.status(200).json(newPost);
} catch (error) {
console.error('Error creating post:', error);
res.status(500).json({ error: 'Error creating post' });
return res.status(500).json({ error: 'Error creating post' });
}
// result = await createPost();
// return res.status(200).json(result);
}

return res.status(200).json(result);
}

1 comment on commit 096110f

@vercel
Copy link

@vercel vercel bot commented on 096110f May 17, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

kylog โ€“ ./

kylog-neatkyu.vercel.app
kylog-eight.vercel.app
kylog-git-main-neatkyu.vercel.app

Please sign in to comment.