From 8ee0c73ab56a475a1c11827e756176041631f33e Mon Sep 17 00:00:00 2001 From: Dillon Kearns Date: Sun, 5 Feb 2023 17:12:02 -0800 Subject: [PATCH] Add deletePost definition. --- examples/blog-engine/custom-backend-task.ts | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/examples/blog-engine/custom-backend-task.ts b/examples/blog-engine/custom-backend-task.ts index 7ed926a5..7c510111 100644 --- a/examples/blog-engine/custom-backend-task.ts +++ b/examples/blog-engine/custom-backend-task.ts @@ -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({