Skip to content

Commit

Permalink
wip: prepare DELETE /api/threads/[id] endpoint
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuget committed Sep 11, 2023
1 parent 1034988 commit 6de8a82
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 3 deletions.
7 changes: 7 additions & 0 deletions server/api/threads/[id]/delete.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export default defineEventHandler(async (event: any) => {
const threadId = parseInt(getRouterParam(event, 'id') || '')

console.log(`DELETE /api/threads/${threadId}`)

return 'ok'
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { prisma } from '../../../prisma/db'
import { prisma } from '../../../../prisma/db'

export default defineEventHandler(async (event: any) => {
const threadId = parseInt(getRouterParam(event, 'id') || '')
Expand All @@ -18,6 +18,6 @@ export default defineEventHandler(async (event: any) => {
const [latest] = thread.versions.slice(-1)
result.latest = latest
}
// console.log(result)
// console.log(result)
return result;
})
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { prisma } from '../../../prisma/db'
import { prisma } from '../../../../prisma/db'

type UpdateThreadRequest = {
published: boolean
Expand Down

0 comments on commit 6de8a82

Please sign in to comment.