Chore: Add Facebook app set up documentation (#647)
Co-authored-by: Pranav Raj S <pranavrajs@gmail.com>
This commit is contained in:
@@ -68,6 +68,7 @@
|
||||
/* global FB */
|
||||
import { required } from 'vuelidate/lib/validators';
|
||||
import LoadingState from 'dashboard/components/widgets/LoadingState';
|
||||
import { mapGetters } from 'vuex';
|
||||
import ChannelApi from '../../../../../api/channels';
|
||||
import PageHeader from '../../SettingsSubPageHeader';
|
||||
import router from '../../../../index';
|
||||
@@ -111,6 +112,12 @@ export default {
|
||||
getSelectablePages() {
|
||||
return this.pageList.filter(item => !item.exists);
|
||||
},
|
||||
...mapGetters({
|
||||
currentUser: 'getCurrentUser',
|
||||
}),
|
||||
accountId() {
|
||||
return this.currentUser.account_id;
|
||||
},
|
||||
},
|
||||
|
||||
created() {
|
||||
@@ -194,13 +201,20 @@ export default {
|
||||
);
|
||||
},
|
||||
|
||||
fetchPages(_token) {
|
||||
ChannelApi.fetchFacebookPages(_token)
|
||||
.then(response => {
|
||||
this.pageList = response.data.data.page_details;
|
||||
this.user_access_token = response.data.data.user_access_token;
|
||||
})
|
||||
.catch();
|
||||
async fetchPages(_token) {
|
||||
try {
|
||||
const response = await ChannelApi.fetchFacebookPages(
|
||||
_token,
|
||||
this.accountId
|
||||
);
|
||||
const {
|
||||
data: { data },
|
||||
} = response;
|
||||
this.pageList = data.page_details;
|
||||
this.user_access_token = data.user_access_token;
|
||||
} catch (error) {
|
||||
// Ignore error
|
||||
}
|
||||
},
|
||||
|
||||
channelParams() {
|
||||
|
||||
Reference in New Issue
Block a user