fix(users.py): update error message to be more generic and not reveal specific reason for username unavailability
fix(AdminPage/index.tsx): fix nullish assertion for create_at and updated_at properties to avoid potential errors fix(signUpPage/index.tsx): fix error handling to correctly display error message fix(types/components/index.ts): make id, create_at, and updated_at properties optional in UserInputType
This commit is contained in:
parent
d73b3b0b52
commit
cf8df6c62b
4 changed files with 7 additions and 7 deletions
|
|
@ -43,7 +43,7 @@ def add_user(
|
|||
db.refresh(new_user)
|
||||
except IntegrityError as e:
|
||||
db.rollback()
|
||||
raise HTTPException(status_code=400, detail="This username is unavailable as it has already been claimed. Please choose a different username.") from e
|
||||
raise HTTPException(status_code=400, detail="This username is unavailable.") from e
|
||||
|
||||
return new_user
|
||||
|
||||
|
|
|
|||
|
|
@ -348,14 +348,14 @@ export default function AdminPage() {
|
|||
</TableCell>
|
||||
<TableCell className="truncate py-2 ">
|
||||
{
|
||||
new Date(user.create_at)
|
||||
new Date(user.create_at!)
|
||||
.toISOString()
|
||||
.split("T")[0]
|
||||
}
|
||||
</TableCell>
|
||||
<TableCell className="truncate py-2">
|
||||
{
|
||||
new Date(user.updated_at)
|
||||
new Date(user.updated_at!)
|
||||
.toISOString()
|
||||
.split("T")[0]
|
||||
}
|
||||
|
|
|
|||
|
|
@ -51,7 +51,7 @@ export default function SignUp(): JSX.Element {
|
|||
} = error;
|
||||
setErrorData({
|
||||
title: "Error signing up",
|
||||
list: [detail[0].msg],
|
||||
list: [detail],
|
||||
});
|
||||
return;
|
||||
});
|
||||
|
|
|
|||
|
|
@ -266,9 +266,9 @@ export type UserInputType = {
|
|||
password: string;
|
||||
is_active?: boolean;
|
||||
is_superuser?: boolean;
|
||||
id: string;
|
||||
create_at: string;
|
||||
updated_at:string;
|
||||
id?: string;
|
||||
create_at?: string;
|
||||
updated_at?:string;
|
||||
};
|
||||
|
||||
export type ApiKeyType = {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue