const getSlackPrivateChannelList = (communityId: string, token: ?string) => { if (!token) return []; const decryptedToken = decryptString(token); return axios .get( `https://slack.com/api/groups.list?token=${decryptedToken}&exclude_archived=true&exclude_members=true` ) .then(response => { return handleSlackChannelResponse(response.data, communityId); }) .catch(error => { console.error('\n\nerror', error); return []; }); }
axios .get(`${baseURI}api/client/settings`, {params: {property}}) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SETTINGS_FETCH_REQUEST_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.CLIENT_SETTINGS_FETCH_REQUEST_ERROR, error, }); }, )
axios .get(`${baseURI}api/feed-monitor/items`, query) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITOR_ITEMS_FETCH_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITOR_ITEMS_FETCH_ERROR, error, }); }, )
axios .get(`${baseURI}api/settings`, {params: {property}}) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FETCH_REQUEST_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FETCH_REQUEST_ERROR, error, }); }, )
axios .get(`${baseURI}api/feed-monitor`, query) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITORS_FETCH_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITORS_FETCH_ERROR, error, }); }, )
axios .get(`${baseURI}api/feed-monitor/feeds`, query) .then((json = {}) => json.data) .then( data => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITOR_FEEDS_FETCH_SUCCESS, data, }); }, error => { AppDispatcher.dispatchServerAction({ type: ActionTypes.SETTINGS_FEED_MONITOR_FEEDS_FETCH_ERROR, error, }); }, )
const getSlackPublicChannelList = (communityId: string, token: string) => { if (!token) return []; const decryptedToken = decryptString(token); return axios .get( `https://slack.com/api/channels.list?token=${decryptedToken}&exclude_archived=true&exclude_members=true` ) .then(response => { return handleSlackChannelResponse(response.data, communityId); }) .catch(error => { console.error('\n\nerror', error); return []; }); }