MCPcopy Index your code
hub / github.com/TaskingAI/TaskingAI / fetchRetrievalData

Function fetchRetrievalData

frontend/src/Redux/actions.ts:163–190  ·  view source on GitHub ↗
(params: any)

Source from the content-addressed store, hash-verified

161 };
162};
163export const fetchRetrievalData = (params: any) => {
164 return (dispatch: any) => {
165 const project_base_url = 'api/v1'
166 dispatch(fetchRetrievalRequest());
167 const data = params
168 let str = ''
169 if (data.hasOwnProperty('name_search')) {
170 str += `prefix_filter={"name":"${data.name_search}"}&`
171 delete data.name_search
172 } else if (data.hasOwnProperty('id_search')) {
173 str += `prefix_filter={"collection_id":"${data.id_search}"}&`
174 delete data.id_search
175 }
176 if (data) {
177 Object.keys(data).forEach(key => {
178 str += `${key}=${data[key]}&`
179 })
180 str = str.substring(0, str.length - 1)
181 }
182 request.get(`${project_base_url}/ui/collections?${str}`)
183 .then(response => {
184 dispatch(fetchRetrievalSuccess(response));
185 })
186 .catch(error => {
187 dispatch(fetchRetrievalFailure(error.message));
188 });
189 };
190};
191export const fetchPluginData = (limit: number) => {
192 return (dispatch: any) => {
193 const project_base_url = 'api/v1'

Callers 4

onDeleteConfirmFunction · 0.90
handleRequestFunction · 0.90
fetchDataRetrievalDataFunction · 0.90
ProjectHomeFunction · 0.90

Calls 4

fetchRetrievalRequestFunction · 0.85
fetchRetrievalSuccessFunction · 0.85
fetchRetrievalFailureFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected