import { json } from "@utils/ajax"; import { GET_SEARCH_RESULT } from '@store/types/medicalInfo'; export const getSearchList = (val) => { if(val.trim() == ''){ const data = []; return (dispatch) => dispatch({ type: GET_SEARCH_RESULT, searchResult: [] }) } return (dispatch, getState) => { json('/retrieval/getStaticKnowledge',{ inputStr:val, inputIds:[] }) .then((res)=>{ const data = res.data.data; dispatch({ type: GET_SEARCH_RESULT, searchResult: data }) }) } };