Skip to content

Commit

Permalink
get and update ticket types on ticket list page
Browse files Browse the repository at this point in the history
Signed-off-by: Tomás Castillo <[email protected]>
  • Loading branch information
tomrndom committed Nov 6, 2024
1 parent a3df76f commit 3f0a781
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 12 deletions.
30 changes: 18 additions & 12 deletions src/pages/tickets/ticket-list-page.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,8 @@ import {
clearAllSelectedTicket,
setSelectedAll,
printTickets,
getTicket
getTicket,
getTicketTypes
} from "../../actions/ticket-actions";
import { getSummitById } from "../../actions/summit-actions";
import QrReaderInput from "../../components/inputs/qr-reader-input";
Expand Down Expand Up @@ -175,7 +176,8 @@ class TicketListPage extends React.Component {
orderDir,
filters,
extraColumns,
getTickets
getTickets,
getTicketTypes
} = this.props;

if (currentSummit) {
Expand All @@ -189,15 +191,18 @@ class TicketListPage extends React.Component {
enabledFilters,
ticketFilters: { ...ticketFilters, ...filters }
}));
getTickets(
term,
DEFAULT_CURRENT_PAGE,
DEFAULT_PER_PAGE,
order,
orderDir,
filters,
extraColumns
);
if (currentSummit) {
getTicketTypes(currentSummit);
getTickets(
term,
DEFAULT_CURRENT_PAGE,
DEFAULT_PER_PAGE,
order,
orderDir,
filters,
extraColumns
);
}
}
}

Expand Down Expand Up @@ -1450,5 +1455,6 @@ export default connect(mapStateToProps, {
getTicket,
getBadgeTypes,
saveFilterCriteria,
deleteFilterCriteria
deleteFilterCriteria,
getTicketTypes
})(TicketListPage);
12 changes: 12 additions & 0 deletions src/reducers/summits/current-summit-reducer.js
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ import { RECEIVE_USER_ROLES_BY_SUMMIT } from "../../actions/user-chat-roles-acti

import {
RECEIVE_REFUND_POLICIES,
RECEIVE_TICKET_TYPES,
TICKET_TYPES_CURRENCY_UPDATED
} from "../../actions/ticket-actions";
import {
Expand Down Expand Up @@ -758,6 +759,17 @@ const currentSummitReducer = (state = DEFAULT_STATE, action) => {
}
};
}
case RECEIVE_TICKET_TYPES: {
const ticketTypes = payload.response.data;

return {
...state,
currentSummit: {
...state.currentSummit,
ticket_types: ticketTypes
}
};
}
default:
return state;
}
Expand Down

0 comments on commit 3f0a781

Please sign in to comment.