Skip to content
Snippets Groups Projects
Unverified Commit 28f36c2a authored by Nick Fitzpatrick's avatar Nick Fitzpatrick Committed by GitHub
Browse files

invalidate revisions on question revert (#22152)

 invalidate revisions on question revert
parent 3bffb4f5
No related branches found
No related tags found
No related merge requests found
......@@ -23,12 +23,15 @@ const Revision = createEntity({
objectActions: {
// use thunk since we don't actually want to dispatch an action
revert: revision => (dispatch, getState) =>
Revision.api.revert({
revert: revision => async (dispatch, getState) => {
await Revision.api.revert({
entity: revision.model_type,
id: revision.model_id,
revision_id: revision.id,
}),
});
return dispatch(Revision.actions.invalidateLists());
},
},
actionShouldInvalidateLists(action) {
......
......@@ -133,6 +133,7 @@ describe("scenarios > question > saved", () => {
cy.findByRole("button", { name: "Revert" }).click();
cy.findByText(/Reverted to an earlier revision/i);
cy.findByText(/This is a question/i).should("not.exist");
});
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment