Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions src/actions/__tests__/sponsor-forms-actions.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ describe("Sponsor Forms Actions", () => {
showArchived: false,
order: "id",
orderDir: 1,
currentPage: 2,
page: 2,
perPage: 50,
term: ""
}
Expand Down Expand Up @@ -198,6 +198,7 @@ describe("Sponsor Forms Actions", () => {

beforeEach(() => {
jest.spyOn(methods, "getAccessTokenSafely").mockReturnValue("TOKEN");
getRequest.mockClear();

putRequest.mockImplementation((...requestArgs) => {
const [, receiveActionCreator] = requestArgs;
Expand Down Expand Up @@ -280,7 +281,7 @@ describe("Sponsor Forms Actions", () => {
showArchived: false,
order: "name",
orderDir: -1,
currentPage: 3,
page: 3,
perPage: 25,
term: "expo"
}
Expand Down
10 changes: 5 additions & 5 deletions src/actions/sponsor-forms-actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const SPONSOR_FORM_ITEM_UNARCHIVED = "SPONSOR_FORM_ITEM_UNARCHIVED";
export const getSponsorForms =
(
term = "",
currentPage = DEFAULT_CURRENT_PAGE,
page = DEFAULT_CURRENT_PAGE,
perPage = DEFAULT_PER_PAGE,
order = "id",
orderDir = DEFAULT_ORDER_DIR,
Expand All @@ -132,7 +132,7 @@ export const getSponsorForms =
}

const params = {
page: currentPage,
page,
fields:
"id,code,name,level,expire_date,is_archived,sponsorship_types,apply_to_all_types,opens_at,expires_at",
relations: "items,sponsorship_types",
Expand Down Expand Up @@ -164,7 +164,7 @@ export const getSponsorForms =
createAction(RECEIVE_SPONSOR_FORMS),
`${window.PURCHASES_API_URL}/api/v1/summits/${currentSummit.id}/show-forms`,
authErrorHandler,
{ order, orderDir, currentPage, perPage, term, showArchived }
{ order, orderDir, page, perPage, term, showArchived }
)(params)(dispatch).then(() => {
dispatch(stopLoading());
});
Expand Down Expand Up @@ -552,7 +552,7 @@ export const getSponsorManagedForms =
createAction(RECEIVE_SPONSOR_MANAGED_FORMS),
`${window.PURCHASES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsorId}/managed-forms`,
authErrorHandler,
{ order, orderDir, page, term, summitTZ, showArchived }
{ order, orderDir, page, perPage, term, summitTZ, showArchived }
)(params)(dispatch).then(() => {
dispatch(stopLoading());
});
Expand Down Expand Up @@ -720,7 +720,7 @@ export const getSponsorCustomizedForms =
createAction(RECEIVE_SPONSOR_CUSTOMIZED_FORMS),
`${window.PURCHASES_API_URL}/api/v1/summits/${currentSummit.id}/sponsors/${sponsorId}/sponsor-forms`,
authErrorHandler,
{ order, orderDir, page, term, summitTZ, showArchived }
{ order, orderDir, page, perPage, term, summitTZ, showArchived }
)(params)(dispatch).then(() => {
dispatch(stopLoading());
});
Expand Down
9 changes: 8 additions & 1 deletion src/pages/sponsors/show-pages-list-page/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,14 @@ const ShowPagesListPage = ({
};

const handlePerPageChange = (newPerPage) => {
getShowPages(term, currentPage, newPerPage, order, orderDir, showArchived);
getShowPages(
term,
DEFAULT_CURRENT_PAGE,
newPerPage,
order,
orderDir,
showArchived
);
};

const handleRowDelete = (itemId) => {
Expand Down
12 changes: 8 additions & 4 deletions src/reducers/sponsors/sponsor-page-forms-list-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@ const sponsorPageFormsListReducer = (state = DEFAULT_STATE, action) => {
return DEFAULT_STATE;
}
case REQUEST_SPONSOR_MANAGED_FORMS: {
const { order, orderDir, page, term, summitTZ, showArchived } = payload;
const { order, orderDir, page, perPage, term, summitTZ, showArchived } =
payload;

return {
...state,
Expand All @@ -67,15 +68,17 @@ const sponsorPageFormsListReducer = (state = DEFAULT_STATE, action) => {
order,
orderDir,
forms: [],
currentPage: page
currentPage: page,
perPage
},
term,
summitTZ,
showArchived
};
}
case REQUEST_SPONSOR_CUSTOMIZED_FORMS: {
const { order, orderDir, page, term, summitTZ, showArchived } = payload;
const { order, orderDir, page, perPage, term, summitTZ, showArchived } =
payload;

return {
...state,
Expand All @@ -84,7 +87,8 @@ const sponsorPageFormsListReducer = (state = DEFAULT_STATE, action) => {
order,
orderDir,
forms: [],
currentPage: page
currentPage: page,
perPage
},
term,
summitTZ,
Expand Down
Loading