(collectionId: string, params: Record<string, any>)
| 128 | fetchData(collectionId, params) |
| 129 | }, [collectionId]) |
| 130 | const fetchData = async (collectionId: string, params: Record<string, any>) => { |
| 131 | setLoading(true); |
| 132 | try { |
| 133 | const res: any = await getRecordsList(collectionId, params) |
| 134 | const data = res.data.map((item: any) => { |
| 135 | return { |
| 136 | ...item, |
| 137 | key: item.chunk_id |
| 138 | } |
| 139 | }) |
| 140 | setRecordList(data); |
| 141 | setHasMore(res.has_more) |
| 142 | |
| 143 | } catch (error) { |
| 144 | console.log(error) |
| 145 | } |
| 146 | setLoading(false); |
| 147 | }; |
| 148 | const handleCreatePrompt = () => { |
| 149 | setContentValue('') |
| 150 | setRecordId('') |
no test coverage detected