fix: comment ref not found statud code

Signed-off-by: Innei <i@innei.in>
This commit is contained in:
Innei
2023-11-21 20:35:51 +08:00
parent 66c2151ae6
commit 3a0f67ad40

View File

@@ -18,7 +18,6 @@ import {
Inject,
Injectable,
Logger,
NotFoundException,
} from '@nestjs/common'
import { CannotFindException } from '~/common/exceptions/cant-find.exception'
@@ -177,7 +176,7 @@ export class CommentService implements OnModuleInit {
}
}
if (!ref) {
throw new NotFoundException('评论文章不存在')
throw new BadRequestException('评论文章不存在')
}
const commentIndex = ref.commentsIndex || 0
doc.key = `#${commentIndex + 1}`