forked from baron/baron-sso
refactor(adminfront): replace sonner with custom use-toast matching devfront UX policy
This commit is contained in:
@@ -20,6 +20,7 @@ import {
|
||||
createUser,
|
||||
fetchTenant,
|
||||
fetchTenants,
|
||||
fetchMe,
|
||||
} from "../../lib/adminApi";
|
||||
import { t } from "../../lib/i18n";
|
||||
|
||||
@@ -78,8 +79,9 @@ function UserCreatePage() {
|
||||
|
||||
// Lock company for tenant_admin
|
||||
React.useEffect(() => {
|
||||
if (profile?.role === "tenant_admin" && profile.companyCode) {
|
||||
setValue("companyCode", profile.companyCode);
|
||||
const p = profile as any;
|
||||
if (p?.role === "tenant_admin" && p.companyCode) {
|
||||
setValue("companyCode", p.companyCode);
|
||||
}
|
||||
}, [profile, setValue]);
|
||||
|
||||
@@ -360,7 +362,7 @@ function UserCreatePage() {
|
||||
id="companyCode"
|
||||
className="flex h-9 w-full rounded-md border border-input bg-transparent px-3 py-1 text-sm shadow-sm transition-colors file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:cursor-not-allowed disabled:opacity-50"
|
||||
{...register("companyCode")}
|
||||
disabled={profile?.role === "tenant_admin"}
|
||||
disabled={(profile as any)?.role === "tenant_admin"}
|
||||
>
|
||||
<option value="">
|
||||
{t(
|
||||
|
||||
Reference in New Issue
Block a user