Skip to content

Commit

Permalink
feat(next/api): export tickets no need currentUser.email anymore
Browse files Browse the repository at this point in the history
  • Loading branch information
sdjdd committed Mar 27, 2024
1 parent e52bf35 commit bcb3f2c
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions next/api/src/router/ticket.ts
Original file line number Diff line number Diff line change
Expand Up @@ -300,9 +300,6 @@ router.get(
parseRange('createdAt'),
async (ctx) => {
const currentUser = ctx.state.currentUser as User;
if (!currentUser.email) {
ctx.throw(400, '邮箱未设置,请前往个人设置页面进行设置');
}
const { page, pageSize, utcOffset, ...rest } = exportTicketParamsSchema.validateSync(ctx.query);
const sortItems = sort.get(ctx);
await createTicketExportJob({
Expand Down Expand Up @@ -751,7 +748,7 @@ router.patch('/:id', async (ctx) => {
}

if (data.title || data.content) {
if (!isCustomerService || currentUser.id !== ticket.authorId ) {
if (!isCustomerService || currentUser.id !== ticket.authorId) {
ctx.throw(403, 'Update title or content is not allowed');
}
if (data.title) {
Expand Down

0 comments on commit bcb3f2c

Please sign in to comment.