Hide details when clicking upvote/downvote

This commit is contained in:
Lucas Verney 2018-07-30 20:35:52 +02:00
parent c19bd60174
commit 66b110e9ef

View File

@ -29,11 +29,15 @@ export function fetchReports({ commit }) {
} }
export function downvote({ commit }, { id }) { export function downvote({ commit }, { id }) {
// Hide details
commit(SHOW_REPORT_DETAILS, { id: null, userAsked: null });
return api.downvote(id) return api.downvote(id)
.then(report => commit(PUSH_REPORT, { report })); .then(report => commit(PUSH_REPORT, { report }));
} }
export function upvote({ commit }, { id }) { export function upvote({ commit }, { id }) {
// Hide details
commit(SHOW_REPORT_DETAILS, { id: null, userAsked: null });
return api.upvote(id) return api.upvote(id)
.then(report => commit(PUSH_REPORT, { report })); .then(report => commit(PUSH_REPORT, { report }));
} }