Add deletePost definition.

This commit is contained in:
Dillon Kearns 2023-02-05 17:12:02 -08:00
parent 7f6f2c19e5
commit 8ee0c73ab5

View File

@ -60,6 +60,13 @@ export async function updatePost({ slug, title, body, publish }) {
}
}
export async function deletePost({ slug }) {
await prisma.post.delete({
where: { slug },
});
return null;
}
export async function getPost(slug) {
try {
return await prisma.post.findFirst({