a lot of things

This commit is contained in:
2026-02-20 11:46:30 -06:00
parent 987a1c8a6a
commit 70284bc14e
37 changed files with 1080 additions and 79 deletions
+10 -1
View File
@@ -1,13 +1,22 @@
import { ContentfulStatusCode } from "hono/utils/http-status";
import { z } from "zod";
import { apiResponse } from "../../../modules/api-utils/apiResponse";
import { createRoute } from "../../../modules/api-utils/createRoute";
import { authMiddleware } from "../../middleware/authorization";
const updateSchema = z
.object({
name: z.string().optional(),
image: z.string().optional(),
})
.strict();
export default createRoute(
"patch",
["/@me"],
async (c) => {
const updatedUser = await c.get("user")?.update(await c.req.json());
const body = updateSchema.parse(await c.req.json());
const updatedUser = await c.get("user")?.update(body);
const response = apiResponse.successful(
"Successfully updated user.",
updatedUser?.toJson(),