refactor: ♻️ Use native Hono return functions instead of custom ones

This commit is contained in:
Jesse Wierzbinski 2024-08-19 21:03:59 +02:00 committed by April John
parent 1a8e063f87
commit a601bc856e
105 changed files with 639 additions and 581 deletions

View file

@ -1,5 +1,5 @@
import { apiRoute, applyConfig, handleZodError } from "@/api";
import { errorResponse, response } from "@/response";
import { response } from "@/response";
import { zValidator } from "@hono/zod-validator";
import { z } from "zod";
@ -50,7 +50,7 @@ export default apiRoute((app) =>
const buffer = await file.arrayBuffer();
if (!(await file.exists())) {
return errorResponse("File not found", 404);
return context.json({ error: "File not found" }, 404);
}
// Can't directly copy file into Response because this crashes Bun for now