fix: update user type inference should be fully partial

This commit is contained in:
Bereket Engida
2025-03-02 19:44:49 +03:00
parent 2231de8f9f
commit f68561fccf

View File

@@ -10,6 +10,7 @@ import { parseUserInput } from "../../db/schema";
import { generateRandomString } from "../../crypto";
import { BASE_ERROR_CODES } from "../../error/codes";
import { originCheck } from "../middlewares";
import type { Prettify } from "../../types/helper";
export const updateUser = <O extends BetterAuthOptions>() =>
createAuthEndpoint(
@@ -20,10 +21,14 @@ export const updateUser = <O extends BetterAuthOptions>() =>
use: [sessionMiddleware],
metadata: {
$Infer: {
body: {} as AdditionalUserFieldsInput<O> & {
name?: string;
image?: string | null;
},
body: {} as Partial<
Prettify<
AdditionalUserFieldsInput<O> & {
name?: string;
image?: string | null;
}
>
>,
},
openapi: {
description: "Update the current user",