{"version":3,"file":"component---src-pages-join-our-community-form-js-858072476e734ed02739.js","mappings":"iPAmNA,MA/MA,SAAqCA,GACnC,MAAM,EAACC,EAAO,EAACC,IAAaC,EAAAA,EAAAA,UAAS,CAAC,GAChCC,EAAaC,EAAAA,QAAYC,GAAGD,EAAAA,UAAcE,WA0MhD,OAxMAC,EAAAA,EAAAA,YAAU,KACR,MAAMP,EAAS,CACbQ,UAAW,CACTC,MAAO,YACPC,KAAM,OACNC,UAAU,GAEZC,YAAa,CACXH,MAAO,cACPC,KAAM,OACNC,UAAU,GAEZE,aAAc,CACZJ,MAAO,eACPC,KAAM,QAERI,MAAO,CACLL,MAAO,QACPC,KAAM,QACNC,UAAU,GAEZI,aAAc,CACZN,MAAO,eACPC,KAAM,OACNC,UAAU,GAEZK,UAAW,CACTP,MAAO,6BACPC,KAAM,SACNC,UAAU,EACVM,QAAS,CACP,CACEC,MAAO,aACPT,MAAO,cAET,CACES,MAAO,eACPT,MAAO,kBAKbU,oBAAqB,CACnBV,MAAO,sCACPC,KAAM,YAERU,OAAQ,CACNX,MAAO,uBACPC,KAAM,OACNV,OAAQG,IAIa,eAArBJ,EAAOiB,YACThB,EAAOqB,iCAAmC,CACxCZ,MAAO,mBACPC,KAAM,SACNC,UAAU,EACVM,QAAS,CACP,CACEC,MAAO,wBACPT,MAAO,yBAET,CACES,MAAO,8BACPT,MAAO,+BAET,CACES,MACE,gEACFT,MACE,iEAEJ,CACES,MAAO,2BACPT,MAAO,4BAET,CACES,MAAO,4BACPT,MAAO,6BAET,CACES,MAAO,SACPT,MAAO,aAMU,iBAArBV,EAAOiB,YACThB,EAAOsB,sBAAwB,CAC7Bb,MAAO,4BACPC,KAAM,SACNC,UAAU,EACVM,QAAS,CACP,CACEC,MAAO,uBACPT,MAAO,wBAET,CACES,MAAO,YACPT,MAAO,aAET,CACES,MAAO,OACPT,MAAO,QAET,CACES,MAAO,MACPT,MAAO,OAET,CACES,MAAO,sBACPT,MAAO,uBAET,CACES,MAAO,6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C,UAAW,SAEXV,KAAM,CACJ/B,UAAWsC,EAAStC,UACpBR,UAAW8C,EAAS9C,UACpBI,YAAa0C,EAAS1C,YACtBC,aAAcyC,EAASzC,aACvBC,MAAOwC,EAASxC,MAChBC,aAAcuC,EAASvC,aACvB2C,QAASJ,EAASI,QAClBvC,oBAAqBmC,EAASnC,oBAC9BC,OAA0B,QAApB8B,EAAEI,EAASlC,OAAO,UAAE,IAAA8B,OAAA,EAAlBA,EAAoBS,IAC5BtC,iCACEiC,EAASjC,iCACXE,mCACE+B,EAAS/B,mCACXD,sBAAuBgC,EAAShC,sBAChCE,mBAAoB8B,EAAS9B,mBAC7BkC,QAAS,kBAIf,IAME,GAAsB,aALDf,EAAAA,EAAMC,KACxB,qDACDO,IAGSS,OACT,OAAOC,EAAAA,GAAMC,QAAQ,UAAW,CAC9BC,SAAUF,EAAAA,GAAMG,SAASC,aAG3BJ,EAAAA,GAAMK,MAAM,wBAAyB,CACnCH,SAAUF,EAAAA,GAAMG,SAASC,YAG/B,CAAE,MAAOE,GAEP,OADAf,QAAQC,IAAI,aAAcc,GACnBN,EAAAA,GAAMK,MAAM,wBAAyB,CAC1CH,SAAUF,EAAAA,GAAMG,SAASC,YAE7B,MAqCJ,C","sources":["webpack://indian-esg-network/./src/formBuilder/join-our-community-form-builder.js","webpack://indian-esg-network/./src/pages/join-our-community-form.js"],"sourcesContent":["import { useState, useEffect } from \"react\"\nimport Countries from \"../pages/countries.json\"\nimport * as yup from \"yup\"\n\nfunction JoinOurCommunityFormBuilder(values) {\n const [schema, setSchema] = useState({})\n const fileSchema = yup.array().of(yup.object()).nullable()\n\n useEffect(() => {\n const schema = {\n full_name: {\n label: \"Full Name\",\n type: \"text\",\n required: true,\n },\n designation: {\n label: \"Designation\",\n type: \"text\",\n required: true,\n },\n company_name: {\n label: \"Company Name\",\n type: \"text\",\n },\n email: {\n label: \"Email\",\n type: \"email\",\n required: true,\n },\n phone_number: {\n label: \"Phone Number\",\n type: \"text\",\n required: true,\n },\n form_type: {\n label: \"Join Indian ESG Network as\",\n type: \"select\",\n required: true,\n options: [\n {\n value: \"individual\",\n label: \"Individual\",\n },\n {\n value: \"organisation\",\n label: \"Organisation\",\n },\n ],\n },\n\n bio_or_website_link: {\n label: \"Share Bio / Linkedin / website link\",\n type: \"textarea\",\n },\n resume: {\n label: \"Any Related Document\",\n type: \"file\",\n schema: fileSchema,\n },\n }\n\n if (values.form_type === \"individual\") {\n schema.areas_of_interest_for_individual = {\n label: \"Area of Interest\",\n type: \"select\",\n required: true,\n options: [\n {\n value: \"Become an ESG Trainer\",\n label: \"Become an ESG Trainer\",\n },\n {\n value: \"Join the Indian ESG Network\",\n label: \"Join the Indian ESG Network\",\n },\n {\n value:\n \"Knowledge sharing (articles/blogs) through Indian ESG Network\",\n label:\n \"Knowledge sharing (articles/blogs) through Indian ESG Network\",\n },\n {\n value: \"Participate as a Speaker\",\n label: \"Participate as a Speaker\",\n },\n {\n value: \"Participate in Talk Shows\",\n label: \"Participate in Talk Shows\",\n },\n {\n value: \"Others\",\n label: \"Others\",\n },\n ],\n }\n }\n\n if (values.form_type === \"organisation\") {\n schema.organisation_category = {\n label: \"Category of Organizations\",\n type: \"select\",\n required: true,\n options: [\n {\n value: \"Academic Institution\",\n label: \"Academic Institution\",\n },\n {\n value: \"Corporate\",\n label: \"Corporate\",\n },\n {\n value: \"MSME\",\n label: \"MSME\",\n },\n {\n value: \"NGO\",\n label: \"NGO\",\n },\n {\n value: \"Social Organization\",\n label: \"Social Organization\",\n },\n {\n value: \"ESG Implementation Partner\",\n label: \"ESG Implementation Partner\",\n },\n {\n value: \"Sustainable Solutions\",\n label: \"Sustainable Solutions\",\n },\n {\n value: \"ESG IT Solutions\",\n label: \"ESG IT Solutions\",\n },\n {\n value: \"Others\",\n label: \"Others\",\n },\n ],\n }\n schema.areas_of_interest_for_organisation = {\n label: \"Solutions required from Indian ESG Network\",\n type: \"select\",\n options: [\n {\n value: \"Join the Indian ESG Network\",\n label: \"Join the Indian ESG Network\",\n },\n {\n value: \"Participate in Events\",\n label: \"Participate in Events\",\n },\n {\n value: \"Participate in Talk Shows\",\n label: \"Participate in Talk Shows\",\n },\n {\n value: \"Share Best Practises\",\n label: \"Share Best Practises\",\n },\n {\n value: \"Sponsor Events\",\n label: \"Sponsor Events\",\n },\n {\n value: \"Exhibitor of Sustainable Products at Events\",\n label: \"Exhibitor of Sustainable Products at Events\",\n },\n {\n value: \"Others\",\n label: \"Others\",\n },\n ],\n }\n schema.required_solutions = {\n label: \"Training required from Indian ESG Network\",\n type: \"select\",\n options: [\n {\n value:\n \"Indian ESG Awareness Program in Organisation (for corporates)\",\n label:\n \"Indian ESG Awareness Program in Organisation (for corporates)\",\n },\n {\n value:\n \"Indian ESG Training for Management and Employees (for corporates)\",\n label:\n \"Indian ESG Training for Management and Employees (for corporates)\",\n },\n {\n value:\n \"Training on Social Impact Assessment (for NGO/Social organization)\",\n label:\n \"Training on Social Impact Assessment (for NGO/Social organization)\",\n },\n {\n value: \"Training on Social Audits (for NGO/Social organization)\",\n label: \"Training on Social Audits (for NGO/Social organization)\",\n },\n ],\n }\n }\n\n setSchema(schema)\n }, [values])\n\n return schema\n}\n\nexport default JoinOurCommunityFormBuilder\n","import React from \"react\"\nimport axios from \"axios\"\nimport { ToastContainer, toast } from \"react-toastify\"\nimport { Form } from \"skillstrainer-resource-library\"\nimport JoinOurCommunityFormBuilder from \"../formBuilder/join-our-community-form-builder\"\n\nexport default function UserInterest() {\n const handleSubmit = async register => {\n let payload\n console.log(\"register===\", register)\n\n payload = {\n data: {\n entity: {\n type: \"user-interest\",\n eventId: 1,\n },\n operation: \"insert\",\n\n data: {\n form_type: register.form_type,\n full_name: register.full_name,\n designation: register.designation,\n company_name: register.company_name,\n email: register.email,\n phone_number: register.phone_number,\n country: register.country,\n bio_or_website_link: register.bio_or_website_link,\n resume: register.resume[0]?.url,\n areas_of_interest_for_individual:\n register.areas_of_interest_for_individual,\n areas_of_interest_for_organisation:\n register.areas_of_interest_for_organisation,\n organisation_category: register.organisation_category,\n required_solutions: register.required_solutions,\n country: \"not required\",\n },\n },\n }\n try {\n const result = await axios.post(\n `${process.env.URL}/api/user-interests`,\n payload\n )\n\n if (result.status === 200) {\n return toast.success(\"Success\", {\n position: toast.POSITION.TOP_CENTER,\n })\n } else {\n toast.error(\"Something gone wrong!\", {\n position: toast.POSITION.TOP_CENTER,\n })\n }\n } catch (err) {\n console.log(\"I am error\", err)\n return toast.error(\"Something gone wrong!\", {\n position: toast.POSITION.TOP_CENTER,\n })\n }\n }\n\n return (\n <>\n
\n

Join Indian ESG NETWORK

\n \n\n {\n // * strapi upload logic\n const formData = new FormData()\n formData.append(\"files\", fileData)\n return await axios\n .post(`${process.env.URL}/api/upload`, formData)\n .then(({ data }) => {\n return data[0].id\n })\n },\n },\n },\n }}\n onSubmit={handleSubmit}\n />\n
\n \n )\n}\n"],"names":["values","schema","setSchema","useState","fileSchema","yup","of","nullable","useEffect","full_name","label","type","required","designation","company_name","email","phone_number","form_type","options","value","bio_or_website_link","resume","areas_of_interest_for_individual","organisation_category","areas_of_interest_for_organisation","required_solutions","UserInterest","React","className","ToastContainer","Form","formBuilder","JoinOurCommunityFormBuilder","submitButton","text","plugins","file","services","uploadFn","async","formData","FormData","append","fileData","axios","post","then","_ref","data","id","onSubmit","_register$resume$","payload","console","log","register","entity","eventId","operation","country","url","status","toast","success","position","POSITION","TOP_CENTER","error","err"],"sourceRoot":""}