mirror of
https://github.com/dillonkearns/elm-pages-v3-beta.git
synced 2024-11-26 13:53:16 +03:00
Add deletePost definition.
This commit is contained in:
parent
7f6f2c19e5
commit
8ee0c73ab5
@ -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({
|
||||
|
Loading…
Reference in New Issue
Block a user