Improving user management and auto-refreshing user firms

This commit is contained in:
2025-04-10 01:31:37 +02:00
parent bc059de65b
commit f1fe81a146
13 changed files with 131 additions and 67 deletions

View File

@@ -1,7 +1,19 @@
import { useInvalidateAuthStore } from "@refinedev/core";
import { CrudForm } from "../../lib/crud/components/crud-form";
import {empty_user} from "../../providers/auth-provider";
export const CreateFirm = () => {
const invalidateAuthStore = useInvalidateAuthStore()
const refreshUser = () => {
empty_user();
invalidateAuthStore().then();
}
return (
<CrudForm schemaName={"FirmCreate"} resource={"firms"} />
<CrudForm
schemaName={"FirmCreate"}
resource={"firms"}
onSuccess={() => { refreshUser() }}
/>
)
}