refactor: Use beforeRequest hook with slack app

This commit is contained in:
Faruk AYDIN
2022-10-18 23:01:56 +02:00
parent 3004cf1115
commit 7422f63c62
6 changed files with 24 additions and 20 deletions

View File

@@ -13,19 +13,15 @@ export default {
error: null,
};
const response = await $.http.get('/conversations.list', {
headers: {
Authorization: `Bearer ${$.auth.data.accessToken}`,
},
});
const response = await $.http.get('/conversations.list');
if (response.integrationError) {
channels.error = response.integrationError;
return channels;
}
if (response.data.ok === 'false') {
channels.error = response.data.error;
if (response.data.ok === false) {
channels.error = response.data;
return channels;
}