(params: Record<string, string | number>,type?: string)
| 44 | }, []); |
| 45 | const [modalTableOpen, setModalTableOpen] = useState(false) |
| 46 | const fetchModelsList = async (params: Record<string, string | number>,type?: string) => { |
| 47 | if(type) { |
| 48 | dispatch(fetchModelsData(20) as any); |
| 49 | } |
| 50 | try { |
| 51 | const res: any = await getModelsList(params, 'text_embedding') |
| 52 | const data = res.data.map((item: any) => { |
| 53 | return { |
| 54 | ...item, |
| 55 | key: item.model_id, |
| 56 | } |
| 57 | }) |
| 58 | setModelHasMore(res.has_more) |
| 59 | setOptions(data) |
| 60 | } catch (error) { |
| 61 | console.log(error) |
| 62 | } |
| 63 | } |
| 64 | const handleCancel = () => { |
| 65 | handleModalCloseOrOpen(false) |
| 66 | setDrawerName('') |
no test coverage detected