Improving user management and auto-refreshing user firms
This commit is contained in:
@@ -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() }}
|
||||
/>
|
||||
)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user