Move makeCall to service file
This commit is contained in:
parent
63fee3b615
commit
e7b9eab5b6
@ -10,7 +10,6 @@ import DropdownTrigger from '/imports/ui/components/dropdown/trigger/component';
|
||||
import DropdownContent from '/imports/ui/components/dropdown/content/component';
|
||||
import DropdownList from '/imports/ui/components/dropdown/list/component';
|
||||
import DropdownListItem from '/imports/ui/components/dropdown/list/item/component';
|
||||
import { makeCall } from '/imports/ui/services/api';
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import Chats from '/imports/api/2.0/chat';
|
||||
import Acl from '/imports/startup/acl';
|
||||
@ -117,7 +116,7 @@ class ChatDropdown extends Component {
|
||||
icon={clearIcon}
|
||||
label={intl.formatMessage(intlMessages.clear)}
|
||||
key={_.uniqueId('action-item-')}
|
||||
onClick={() => makeCall('clearPublicChatHistory')}
|
||||
onClick={ChatService.clearPublicChatHistory}
|
||||
/>
|
||||
: null),
|
||||
]);
|
||||
|
@ -1,11 +1,9 @@
|
||||
import Chats from '/imports/api/2.0/chat';
|
||||
import Users from '/imports/api/2.0/users';
|
||||
|
||||
import Auth from '/imports/ui/services/auth';
|
||||
import UnreadMessages from '/imports/ui/services/unread-messages';
|
||||
import Storage from '/imports/ui/services/storage/session';
|
||||
import mapUser from '/imports/ui/services/user/mapUser';
|
||||
|
||||
import { makeCall } from '/imports/ui/services/api';
|
||||
import _ from 'lodash';
|
||||
|
||||
@ -191,6 +189,8 @@ const updateUnreadMessage = (receiverID, timestamp) => {
|
||||
return UnreadMessages.update(chatType, timestamp);
|
||||
};
|
||||
|
||||
const clearPublicChatHistory = () => (makeCall('clearPublicChatHistory'));
|
||||
|
||||
const closePrivateChat = (chatID) => {
|
||||
const currentClosedChats = Storage.getItem(CLOSED_CHAT_LIST_KEY) || [];
|
||||
|
||||
@ -237,4 +237,5 @@ export default {
|
||||
sendMessage,
|
||||
closePrivateChat,
|
||||
exportChat,
|
||||
clearPublicChatHistory,
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user