(params: any)
| 161 | }; |
| 162 | }; |
| 163 | export 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 | }; |
| 191 | export const fetchPluginData = (limit: number) => { |
| 192 | return (dispatch: any) => { |
| 193 | const project_base_url = 'api/v1' |
no test coverage detected