first fixes

This commit is contained in:
Lokowitz
2025-05-17 18:17:22 +00:00
parent 731ec1da69
commit eff812eaa8
27 changed files with 80 additions and 114 deletions

View File

@@ -39,10 +39,8 @@ type CreateRoleFormProps = {
afterCreate?: (res: CreateRoleResponse) => Promise<void>;
};
const t = useTranslations();
const formSchema = z.object({
name: z.string({ message: t('accessRoleNameRequired') }).max(32),
name: z.string({ message: "Name is required" }).max(32),
description: z.string().max(255).optional()
});
@@ -52,6 +50,7 @@ export default function CreateRoleForm({
afterCreate
}: CreateRoleFormProps) {
const { org } = useOrgContext();
const t = useTranslations();
const [loading, setLoading] = useState(false);

View File

@@ -47,10 +47,8 @@ type CreateRoleFormProps = {
afterDelete?: () => void;
};
const t = useTranslations();
const formSchema = z.object({
newRoleId: z.string({ message: t('accessRoleErrorNewRequired') })
newRoleId: z.string({ message: "New role is required" })
});
export default function DeleteRoleForm({
@@ -60,6 +58,7 @@ export default function DeleteRoleForm({
afterDelete
}: CreateRoleFormProps) {
const { org } = useOrgContext();
const t = useTranslations();
const [loading, setLoading] = useState(false);
const [roles, setRoles] = useState<ListRolesResponse["roles"]>([]);