diff --git a/opentech/static_src/src/app/src/api/rounds.js b/opentech/static_src/src/app/src/api/rounds.js index d2dd96a37f5f8045e077a432cc11d12ada794c36..cf8261575443b3539c176b6468ac9886b5f24d98 100644 --- a/opentech/static_src/src/app/src/api/rounds.js +++ b/opentech/static_src/src/app/src/api/rounds.js @@ -1,5 +1,5 @@ import { apiFetch } from '@api/utils'; -export async function fetchRound(id) { - return apiFetch(`/apply/api/rounds/${id}`, 'GET'); +export function fetchRound(id) { + return apiFetch(`/apply/api/rounds/${id}/`, 'GET'); } diff --git a/opentech/static_src/src/app/src/components/GroupedListing/index.js b/opentech/static_src/src/app/src/components/GroupedListing/index.js index 817cd07edf0d42b747f6b797f20a7d3b5da9ba62..be20ffca5dce9385e3511c0c693f0e7caeedb96c 100644 --- a/opentech/static_src/src/app/src/components/GroupedListing/index.js +++ b/opentech/static_src/src/app/src/components/GroupedListing/index.js @@ -92,7 +92,7 @@ export default class GroupedListing extends React.Component { const orderedItems = order.map(({key, display, values}) => ({ name: display, - key: key, + key, items: values.reduce((acc, value) => acc.concat(groupedItems[value] || []), []) })) diff --git a/opentech/static_src/src/app/src/redux/actions/submissions.js b/opentech/static_src/src/app/src/redux/actions/submissions.js index dc2e4610ec385cdf1864d1c8b2d0de26e9d95558..62091b71d15248937338875529347abbb178812f 100644 --- a/opentech/static_src/src/app/src/redux/actions/submissions.js +++ b/opentech/static_src/src/app/src/redux/actions/submissions.js @@ -72,7 +72,7 @@ export const fetchRound = roundID => { if (response.ok) { dispatch(updateRound(roundID, json)); } else { - dispatch(failLoadingRound(json.meta.error)); + dispatch(failLoadingRound(json.detail)); } } catch (e) { dispatch(failLoadingRound(e.message)); @@ -110,7 +110,7 @@ export const fetchSubmissionsByRound = roundID => { if (response.ok) { dispatch(updateSubmissionsByRound(roundID, json)); } else { - dispatch(failLoadingSubmissionsByRound(json.meta.error)); + dispatch(failLoadingSubmissionsByRound(json.detail)); } } catch (e) { dispatch(failLoadingSubmissionsByRound(e.message)); @@ -149,7 +149,7 @@ export const loadCurrentSubmission = (requiredFields=[]) => (dispatch, getState) return null } - return dispatch(fetchSubmission(getCurrentSubmissionID(getState()))) + return dispatch(fetchSubmission(submissionID)) } @@ -163,7 +163,7 @@ export const fetchSubmission = submissionID => { if (response.ok) { dispatch(updateSubmission(submissionID, json)); } else { - dispatch(failLoadingSubmission(json.meta.error)); + dispatch(failLoadingSubmission(json.detail)); } } catch (e) { dispatch(failLoadingSubmission(e.message)); diff --git a/opentech/static_src/src/app/src/redux/selectors/submissions.js b/opentech/static_src/src/app/src/redux/selectors/submissions.js index fc569ac220a5b9ffcca45148e5d608c04585e53a..d00a80dd8e99d05421a121221ab95e2b4ce5cdc9 100644 --- a/opentech/static_src/src/app/src/redux/selectors/submissions.js +++ b/opentech/static_src/src/app/src/redux/selectors/submissions.js @@ -16,7 +16,7 @@ const getCurrentRound = createSelector( const getCurrentSubmissionID = state => state.submissions.current; const getCurrentRoundSubmissionIDs = createSelector( - [ getCurrentRound, getSubmissions], + [ getCurrentRound ], (round) => { return round ? round.submissions.ids : []; }