Pull Request branch dev-clone to main #1

Merged
gitea merged 429 commits from dev-clone into main 2024-12-23 09:31:34 +00:00
Showing only changes of commit c2ae3ec0e3 - Show all commits

View File

@ -147,10 +147,7 @@ const questionsRoute = new Hono<HonoEnv>()
)
);
if (!queryResult.length)
throw new HTTPException(404, {
message: "The question does not exists",
});
if (!queryResult[0]) throw notFound();
const questionData = {
...queryResult[0],
@ -256,10 +253,7 @@ const questionsRoute = new Hono<HonoEnv>()
)
);
if (!question[0])
throw new HTTPException(404, {
message: "The question is not found",
});
if (!question[0]) throw notFound();
if (skipTrash) {
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))
)[0];
if (!question) return c.notFound();
if (!question) throw notFound();
if (!question.deletedAt) {
throw new HTTPException(400, {