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
1 changed files with 4 additions and 0 deletions

View File

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