From 7f25b0f261b5a5fc2696054004fb24673375b91b Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 6 Jul 2018 01:32:43 +0300 Subject: Proptypes & eslint --- vnext/src/api/index.js | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'vnext/src/api') diff --git a/vnext/src/api/index.js b/vnext/src/api/index.js index 653360f5..74280ed5 100644 --- a/vnext/src/api/index.js +++ b/vnext/src/api/index.js @@ -19,14 +19,14 @@ export function me(username = '', password = '') { client.get('/me', { headers: username ? { - 'Authorization': 'Basic ' + window.btoa(unescape(encodeURIComponent(username + ":" + password))) + 'Authorization': 'Basic ' + window.btoa(unescape(encodeURIComponent(username + ':' + password))) } : {} }).then(response => { localStorage.visitor = JSON.stringify(response.data); - resolve(response.data) + resolve(response.data); }).catch(reason => { - localStorage.clear() - reject(reason) + localStorage.clear(); + reject(reason); }) }); } @@ -57,9 +57,9 @@ export function getMessages(path, params) { } export function post(body, attach) { - let form = new FormData() - form.append('attach', attach) - form.append('body', body) + let form = new FormData(); + form.append('attach', attach); + form.append('body', body); return client.post('/post', form); } @@ -69,7 +69,7 @@ export function comment(mid, rid, body, attach) { form.append('rid', rid); form.append('body', body); form.append('attach', attach); - return client.post('/comment', form) + return client.post('/comment', form); } function socialLink(network) { @@ -86,4 +86,4 @@ export function vkLink() { export function markReadTracker(msg, visitor) { return `${apiBaseUrl}/thread/mark_read/${msg.mid}-${msg.rid || 0}.gif?hash=${visitor.hash}`; -} \ No newline at end of file +} -- cgit v1.2.3