mirror of
https://github.com/wassname/talk.git
synced 2026-08-03 13:20:59 +08:00
25 lines
781 B
JavaScript
25 lines
781 B
JavaScript
import * as actions from 'constants/userDetail';
|
|
|
|
export const viewUserDetail = (userId) => ({type: actions.VIEW_USER_DETAIL, userId});
|
|
export const hideUserDetail = () => ({type: actions.HIDE_USER_DETAIL});
|
|
|
|
export const changeUserDetailStatuses = (tab) => {
|
|
let statuses;
|
|
if (tab === 'all') {
|
|
statuses = ['NONE', 'ACCEPTED', 'REJECTED', 'PREMOD'];
|
|
} else if (tab === 'rejected') {
|
|
statuses = ['REJECTED'];
|
|
}
|
|
return {type: actions.CHANGE_USER_DETAIL_STATUSES, tab, statuses};
|
|
};
|
|
|
|
export const clearUserDetailSelections = () => ({type: actions.CLEAR_USER_DETAIL_SELECTIONS});
|
|
|
|
export const toggleSelectCommentInUserDetail = (id, active) => {
|
|
return {
|
|
type: active ? actions.SELECT_USER_DETAIL_COMMENT : actions.UNSELECT_USER_DETAIL_COMMENT,
|
|
id
|
|
};
|
|
};
|
|
|