diff --git a/backend/app/models.py b/backend/app/models.py index b1ad18b0f2..dcedf9a2f5 100644 --- a/backend/app/models.py +++ b/backend/app/models.py @@ -30,8 +30,11 @@ class UserRegister(SQLModel): # Properties to receive via API on update, all are optional -class UserUpdate(UserBase): - email: EmailStr | None = Field(default=None, max_length=255) # type: ignore[assignment] +class UserUpdate(SQLModel): + email: EmailStr | None = Field(default=None, max_length=255) + is_active: bool | None = None + is_superuser: bool | None = None + full_name: str | None = Field(default=None, max_length=255) password: str | None = Field(default=None, min_length=8, max_length=128) @@ -79,8 +82,9 @@ class ItemCreate(ItemBase): # Properties to receive on item update -class ItemUpdate(ItemBase): - title: str | None = Field(default=None, min_length=1, max_length=255) # type: ignore[assignment] +class ItemUpdate(SQLModel): + title: str | None = Field(default=None, min_length=1, max_length=255) + description: str | None = Field(default=None, max_length=255) # Database model, database table inferred from class name diff --git a/frontend/src/client/schemas.gen.ts b/frontend/src/client/schemas.gen.ts index fb66c1f837..ea7b4f5cff 100644 --- a/frontend/src/client/schemas.gen.ts +++ b/frontend/src/client/schemas.gen.ts @@ -431,14 +431,26 @@ export const UserUpdateSchema = { title: 'Email' }, is_active: { - type: 'boolean', - title: 'Is Active', - default: true + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Active' }, is_superuser: { - type: 'boolean', - title: 'Is Superuser', - default: false + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Is Superuser' }, full_name: { anyOf: [ diff --git a/frontend/src/client/types.gen.ts b/frontend/src/client/types.gen.ts index 91b5ba34c2..596b8fc476 100644 --- a/frontend/src/client/types.gen.ts +++ b/frontend/src/client/types.gen.ts @@ -92,8 +92,8 @@ export type UsersPublic = { export type UserUpdate = { email?: (string | null); - is_active?: boolean; - is_superuser?: boolean; + is_active?: (boolean | null); + is_superuser?: (boolean | null); full_name?: (string | null); password?: (string | null); };