[Glitch] Add duration parameter to muting.

Port 96761752ec to glitch-soc

Signed-off-by: Thibaut Girka <thib@sitedethib.com>
This commit is contained in:
OSAMU SATO
2020-10-13 08:01:14 +09:00
committed by Thibaut Girka
parent 813c84cd6c
commit 78ad04420c
7 changed files with 81 additions and 8 deletions

View File

@ -274,11 +274,11 @@ export function unblockAccountFail(error) {
};
export function muteAccount(id, notifications) {
export function muteAccount(id, notifications, duration=0) {
return (dispatch, getState) => {
dispatch(muteAccountRequest(id));
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications }).then(response => {
api(getState).post(`/api/v1/accounts/${id}/mute`, { notifications, duration }).then(response => {
// Pass in entire statuses map so we can use it to filter stuff in different parts of the reducers
dispatch(muteAccountSuccess(response.data, getState().get('statuses')));
}).catch(error => {