mirror of
https://github.com/versia-pub/server.git
synced 2026-03-13 13:59:16 +01:00
refactor: ♻️ Use native Hono return functions instead of custom ones
This commit is contained in:
parent
1a8e063f87
commit
a601bc856e
105 changed files with 639 additions and 581 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue