diff --git a/src/api/endpoints/index.ts b/src/api/endpoints/index.ts index 649881c9..1fe20fb0 100644 --- a/src/api/endpoints/index.ts +++ b/src/api/endpoints/index.ts @@ -154,11 +154,25 @@ export const elasticSearch = async (query) => { const url = API_CONFIG.BASE_SCICRUNCH_URL + API_CONFIG.SCICRUNCH_KEY; try { const result = await fetchData(url, "POST", { - query: { - query_string: { - query: query, - }, - }, + "size": 20, + "from": 0, + "query": { + "bool": { + "must": [ + { + "query_string": { + "fields": [ + "*" + ], + "query": query, + "type": "cross_fields", + "default_operator": "and", + "lenient": "true" + } + } + ] + } + } }); return elasticSearhParser(result?.hits?.hits) } catch (error) { diff --git a/src/components/Auth/Register.jsx b/src/components/Auth/Register.jsx index e5068b38..d0d953d7 100644 --- a/src/components/Auth/Register.jsx +++ b/src/components/Auth/Register.jsx @@ -19,22 +19,16 @@ import { GlobalDataContext } from "../../contexts/DataContext"; // import { register } from "../../api/endpoints/apiService"; const schema = yup.object().shape({ - firstName: yup.string().required("First name is a required field"), - lastName: yup.string().required("Last name is a required field"), email: yup.string().email().required(), username: yup.string().required().min(3), password: yup.string().required().min(10), - organization: yup.string().required() }); const Register = () => { const [formData, setFormData] = React.useState({ - firstName: "", - lastName: "", username: "", email: "", password: "", - organization: "", }); const [errors, setErrors] = React.useState({}); @@ -137,28 +131,6 @@ const Register = () => {