Skip to content

Commit

Permalink
debug reply
Browse files Browse the repository at this point in the history
  • Loading branch information
uffy committed Aug 3, 2024
1 parent 8ee0065 commit b204a92
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions next/api/src/router/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -841,6 +841,8 @@ router.post('/:id/replies', async (ctx) => {
const currentUser = ctx.state.currentUser as User;
const ticket = ctx.state.ticket as Ticket;

console.log("POST replies", ticket.id, new Date())

const data = replyDataSchema.validateSync(ctx.request.body);

const isCustomerService = await currentUser.isCustomerService();
Expand Down Expand Up @@ -880,6 +882,8 @@ router.post('/:id/replies', async (ctx) => {
ctx.throw(400, 'Content and fileIds cannot be empty at the same time');
}

console.log("POST replies (before reply)", ticket.id, new Date())

const reply = await ticket.reply({
author: currentUser,
content: isCustomerService
Expand All @@ -895,6 +899,8 @@ router.post('/:id/replies', async (ctx) => {
internal: data.internal,
});

console.log("POST replies (after reply)", ticket.id, new Date())

ctx.body = new ReplyResponse(reply);
});

Expand Down

0 comments on commit b204a92

Please sign in to comment.