diff options
author | Harrison Healey <harrisonmhealey@gmail.com> | 2016-05-05 16:35:03 -0400 |
---|---|---|
committer | Christopher Speller <crspeller@gmail.com> | 2016-05-05 16:35:03 -0400 |
commit | d2ddf40f56191c1770c3ca93d747a7f1b749f26c (patch) | |
tree | 9cd5d9ac9fc5b9da21fba8df9990c5f927801272 /webapp/utils/async_client.jsx | |
parent | 696ffb4745bec6306f88c5693b8ded89a47f5de7 (diff) | |
download | chat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.tar.gz chat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.tar.bz2 chat-d2ddf40f56191c1770c3ca93d747a7f1b749f26c.zip |
PLT-2600/PLT-2770 Added Get Public Link modal and added new API for public file links (#2892)
* Switched public file links to use a GetLinkModal
* Separated getFile and the new getPublicFile api calls
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r-- | webapp/utils/async_client.jsx | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx index 57888f722..ac651a7bb 100644 --- a/webapp/utils/async_client.jsx +++ b/webapp/utils/async_client.jsx @@ -1343,3 +1343,33 @@ export function regenCommandToken(id) { } ); } + +export function getPublicLink(channelId, userId, filename, success, error) { + const callName = 'getPublicLink' + channelId + userId + filename; + + if (isCallInProgress(callName)) { + return; + } + + callTracker[callName] = utils.getTimestamp(); + + Client.getPublicLink( + channelId, + userId, + filename, + (link) => { + callTracker[callName] = 0; + + success(link); + }, + (err) => { + callTracker[callName] = 0; + + if (error) { + error(err); + } else { + dispatchError(err, 'getPublicLink'); + } + } + ); +}
\ No newline at end of file |