Adding Services dropdown in Organization Creation dropdown.
This commit is contained in:
parent
182280e91d
commit
69c225ac72
@ -6,11 +6,14 @@ import { useCreateTenant, useIndustries } from "../../hooks/useTenant";
|
||||
import { LogoUpload } from "./LogoUpload";
|
||||
import { orgSize, reference } from "../../utils/constants";
|
||||
import moment from "moment";
|
||||
import { useGlobalServices } from "../../hooks/masterHook/useMaster";
|
||||
import SelectMultiple from "../common/SelectMultiple";
|
||||
|
||||
const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
||||
const { data, isError, isLoading: industryLoading } = useIndustries();
|
||||
const [logoPreview, setLogoPreview] = useState(null);
|
||||
const [logoName, setLogoName] = useState("");
|
||||
const { data: services, isLoading: serviceLoading } = useGlobalServices();
|
||||
const {
|
||||
register,
|
||||
control,
|
||||
@ -42,6 +45,7 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
||||
"industryId",
|
||||
"reference",
|
||||
"logoImage",
|
||||
"serviceIds",
|
||||
]);
|
||||
|
||||
if (valid) {
|
||||
@ -198,6 +202,21 @@ const OrganizationInfo = ({ onNext, onPrev, onSubmitTenant }) => {
|
||||
)}
|
||||
</div>
|
||||
|
||||
<div className="col-sm-6">
|
||||
<SelectMultiple
|
||||
required
|
||||
name="serviceIds"
|
||||
label="Services"
|
||||
options={services?.data}
|
||||
isLoading={serviceLoading}
|
||||
labelKey="name"
|
||||
valueKey="id"
|
||||
/>
|
||||
{errors.serviceIds && (
|
||||
<div className="danger-text">{errors.serviceIds.message}</div>
|
||||
)}
|
||||
</div>
|
||||
|
||||
|
||||
<div className="col-sm-12">
|
||||
<Label htmlFor="description">Description</Label>
|
||||
|
@ -33,6 +33,7 @@ export const newTenantSchema = z.object({
|
||||
organizationSize: z.string().nonempty("Organization size is required"),
|
||||
industryId: z.string().uuid("Invalid industry ID"),
|
||||
reference: z.string().nonempty("Reference is required"),
|
||||
serviceIds: z.array(z.string()).nonempty("Services is required"),
|
||||
});
|
||||
|
||||
export const tenantDefaultValues = {
|
||||
@ -51,6 +52,7 @@ export const tenantDefaultValues = {
|
||||
organizationSize: "",
|
||||
industryId: "", // should be a valid UUID if pre-filled
|
||||
reference: "",
|
||||
serviceIds:[]
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user