From a3359a84e33e3bb29ae075e8c3d30ed034bc2b03 Mon Sep 17 00:00:00 2001 From: Rishi Ghan Date: Thu, 2 Mar 2023 00:12:02 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=A7=20Fixed=20the=20response=20in=20wa?= =?UTF-8?q?nted=20reducer=20action?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Rishi Ghan --- src/client/actions/fileops.actions.tsx | 2 +- src/client/components/WantedComics/WantedComics.tsx | 4 ++-- src/client/reducers/fileops.reducer.ts | 3 ++- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/src/client/actions/fileops.actions.tsx b/src/client/actions/fileops.actions.tsx index 3f35c19..d2669a5 100644 --- a/src/client/actions/fileops.actions.tsx +++ b/src/client/actions/fileops.actions.tsx @@ -301,7 +301,7 @@ export const searchIssue = (query, options) => async (dispatch) => { case "wantedComicsPage": dispatch({ type: WANTED_COMICS_FETCHED, - data: response.data.body, + data: response.data.hits, }); break; case "globalSearchBar": diff --git a/src/client/components/WantedComics/WantedComics.tsx b/src/client/components/WantedComics/WantedComics.tsx index 56f0513..e4de3c4 100644 --- a/src/client/components/WantedComics/WantedComics.tsx +++ b/src/client/components/WantedComics/WantedComics.tsx @@ -73,8 +73,8 @@ export const WantedComics = (props): ReactElement => { id: "downloadDetails", accessorKey: "acquisition", cell: data =>
    - {data.getValue().directconnect.downloads.map(download => { - return
  1. {download.name}
  2. ; + {data.getValue().directconnect.downloads.map((download, idx) => { + return
  3. {download.name}
  4. ; })}
}, diff --git a/src/client/reducers/fileops.reducer.ts b/src/client/reducers/fileops.reducer.ts index 50f048f..4c30a1e 100644 --- a/src/client/reducers/fileops.reducer.ts +++ b/src/client/reducers/fileops.reducer.ts @@ -244,9 +244,10 @@ function fileOpsReducer(state = initialState, action) { }; } case WANTED_COMICS_FETCHED: { + console.log(action); const foo = []; if (!isUndefined(action.data.hits)) { - map(action.data.hits.hits, ({ _source }) => { + map(action.data.hits, ({ _source }) => { foo.push(_source); }); }