mirror of
https://github.com/wassname/talk.git
synced 2026-08-03 13:20:59 +08:00
31 lines
904 B
JavaScript
31 lines
904 B
JavaScript
/**
|
|
* Action disptacher related to comments
|
|
*/
|
|
|
|
export const updateStatus = (status, id) => (dispatch, getState) => {
|
|
dispatch({type: 'COMMENT_STATUS_UPDATE', id, status});
|
|
dispatch({type: 'COMMENT_UPDATE', comment: getState().comments.get('byId').get(id)});
|
|
};
|
|
|
|
export const flagComment = id => (dispatch, getState) => {
|
|
dispatch({type: 'COMMENT_FLAG', id});
|
|
dispatch({type: 'COMMENT_UPDATE', comment: getState().comments.get('byId').get(id)});
|
|
};
|
|
|
|
export const createComment = (name, body) => dispatch => {
|
|
dispatch({type: 'COMMENT_CREATE', name, body});
|
|
};
|
|
|
|
// Dialog Actions
|
|
export const showBanUserDialog = (userId, userName, commentId) => {
|
|
return dispatch => {
|
|
dispatch({type: 'SHOW_BANUSER_DIALOG', userId, userName, commentId});
|
|
};
|
|
};
|
|
|
|
export const hideBanUserDialog = (showDialog) => {
|
|
return dispatch => {
|
|
dispatch({type: 'HIDE_BANUSER_DIALOG', showDialog});
|
|
};
|
|
};
|