Skip to content

Commit

Permalink
fix: blurting exception
Browse files Browse the repository at this point in the history
  • Loading branch information
kyeahxx19 committed Nov 22, 2023
1 parent ee323f0 commit 4fef25a
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/blurting/blurting.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -106,8 +106,17 @@ export class BlurtingController {
) {
const { id } = req.user as JwtPayload;
const user = await this.userService.findUserByVal('id', id);
const blurtingPage = await this.blurtingService.getBlurting(user.group, no);
return res.json(blurtingPage);
if (user.group == null) return res.sendStatus(404);
try {
const blurtingPage = await this.blurtingService.getBlurting(
user.group,
no,
);
return res.json(blurtingPage);
} catch (error) {
console.log(error);
return res.send(error);
}
}

@UseGuards(AuthGuard('access'))
Expand Down

0 comments on commit 4fef25a

Please sign in to comment.