Pull Request branch dev-clone to main #1
|
|
@ -147,10 +147,7 @@ const questionsRoute = new Hono<HonoEnv>()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!queryResult.length)
|
if (!queryResult[0]) throw notFound();
|
||||||
throw new HTTPException(404, {
|
|
||||||
message: "The question does not exists",
|
|
||||||
});
|
|
||||||
|
|
||||||
const questionData = {
|
const questionData = {
|
||||||
...queryResult[0],
|
...queryResult[0],
|
||||||
|
|
@ -256,10 +253,7 @@ const questionsRoute = new Hono<HonoEnv>()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (!question[0])
|
if (!question[0]) throw notFound();
|
||||||
throw new HTTPException(404, {
|
|
||||||
message: "The question is not found",
|
|
||||||
});
|
|
||||||
|
|
||||||
if (skipTrash) {
|
if (skipTrash) {
|
||||||
await db.delete(questions).where(eq(questions.id, questionId));
|
await db.delete(questions).where(eq(questions.id, questionId));
|
||||||
|
|
@ -291,7 +285,7 @@ const questionsRoute = new Hono<HonoEnv>()
|
||||||
await db.select().from(questions).where(eq(questions.id, questionId))
|
await db.select().from(questions).where(eq(questions.id, questionId))
|
||||||
)[0];
|
)[0];
|
||||||
|
|
||||||
if (!question) return c.notFound();
|
if (!question) throw notFound();
|
||||||
|
|
||||||
if (!question.deletedAt) {
|
if (!question.deletedAt) {
|
||||||
throw new HTTPException(400, {
|
throw new HTTPException(400, {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user