diff --git a/src/components/Organization/OrgPickerFromSPId.jsx b/src/components/Organization/OrgPickerFromSPId.jsx index 69774947..2b6da36f 100644 --- a/src/components/Organization/OrgPickerFromSPId.jsx +++ b/src/components/Organization/OrgPickerFromSPId.jsx @@ -10,13 +10,15 @@ import { useForm } from "react-hook-form"; import { zodResolver } from "@hookform/resolvers/zod"; import { spridSchema } from "./OrganizationSchema"; import { OrgCardSkeleton } from "./OrganizationSkeleton"; +import { useQueryClient } from "@tanstack/react-query"; + // Zod schema: only allow exactly 4 digits const OrgPickerFromSPId = ({ title, placeholder }) => { - const { onClose, startStep, flowType, onOpen, prevStep } = + const { onClose, startStep, flowType, onOpen, prevStep,orgData } = useOrganizationModal(); - + const clientQuery = useQueryClient() const { register, handleSubmit, @@ -35,8 +37,11 @@ const OrgPickerFromSPId = ({ title, placeholder }) => { const onSubmit = (formdata) => { setSPRID(formdata.spridSearchText); }; - - const handleOrg = (orgId) => {}; + + const handleCrateOrg = () => { + clientQuery.removeQueries({queryKey:["organization"]}) + onOpen({ startStep: 4,orgData:null }) + }; const SP = watch("spridSearchText"); return (