Answer the question
In order to leave comments, you need to log in
How to replace if steam locomotive?
There are four query functions that are passed into one component and are responsible for deleting a specific type of question.
const handleBuyerQuestionDelete = questionId => {
dispatch(OrganizationsActions.deleteEventCustomQuestionRequest(organizationId, eventId, questionId));
};
const handleAllAttendeesQuestionDelete = questionId => {
dispatch(EventsActions.deleteAllAttendeesCustomQuestionRequest(organizationId, eventId, questionId));
};
const handleTicketQuestionDelete = (ticketId, questionId) => {
dispatch(EventsActions.deleteTicketCustomQuestionRequest(organizationId, eventId, ticketId, questionId));
};
const handleAddonQuestionDelete = (addonId, questionId) => {
dispatch(EventsActions.deleteAddonCustomQuestionRequest(organizationId, eventId, addonId, questionId));
};
<QuestionList
label={t('screens.createEventQuestions.misc.questionList')}
questions={questions}
onAddQuestions={handleAddEventQuestions}
onQuestionRequiredChange={onEventQuestionRequiredChange}
onQuestionDelete={handleBuyerQuestionDelete}
/>
const handleDeleteQuestion = () => {
if (addonId) {
onQuestionDelete(addonId, id);
} else if (ticketId) {
onQuestionDelete(ticketId, id);
} else {
onQuestionDelete(id);
}
};
<IconButton className={classes.deleteButton} color="secondary" onClick={handleDeleteQuestion}>
<DeleteIcon fontSize="small" />
</IconButton>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question