Skip to content

Commit

Permalink
chore: add logs on API
Browse files Browse the repository at this point in the history
  • Loading branch information
jbuget committed Sep 11, 2023
1 parent d86f996 commit bd4d190
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 0 deletions.
2 changes: 2 additions & 0 deletions server/api/publications.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ interface Message {
}

export default defineEventHandler(async (event) => {
console.log(`POST /api/publications`)

const body = await readBody(event)
console.log('Publish thread…')
console.log(body)
Expand Down
2 changes: 2 additions & 0 deletions server/api/threads.post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,8 @@ type CreateThreadRequest = {
}

export default defineEventHandler(async (event: any) => {
console.log(`GET /api/threads`)

const threadData: CreateThreadRequest = await readBody(event)
const now = new Date()

Expand Down
3 changes: 3 additions & 0 deletions server/api/threads/[id].post.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ type UpdateThreadRequest = {

export default defineEventHandler(async (event: any) => {
const threadId = parseInt(getRouterParam(event, 'id') || '')

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

const threadData: UpdateThreadRequest = await readBody(event)
const now = new Date()

Expand Down

0 comments on commit bd4d190

Please sign in to comment.