pinafore/src/routes/_pages/requests.html

37 lines
1.1 KiB
HTML
Raw Normal View History

2018-03-16 17:18:40 +01:00
<DynamicPageBanner title="Follow requests" icon="#fa-user-plus" />
{#if $isUserLoggedIn }
<AccountsListPage {accountsFetcher} {accountActions} />
{/if}
2018-03-16 17:18:40 +01:00
<script>
import AccountsListPage from '../_components/AccountsListPage.html'
import { store } from '../_store/store'
2018-03-16 17:18:40 +01:00
import { getFollowRequests } from '../_actions/followRequests'
import DynamicPageBanner from '../_components/DynamicPageBanner.html'
import { setFollowRequestApprovedOrRejected } from '../_actions/requests'
2018-03-16 17:18:40 +01:00
export default {
data: () => ({
accountActions: [
{
icon: '#fa-check',
label: 'Approve',
onclick: (accountId) => setFollowRequestApprovedOrRejected(accountId, true, true)
},
{
icon: '#fa-times',
label: 'Reject',
onclick: (accountId) => setFollowRequestApprovedOrRejected(accountId, false, true)
}
]
}),
2018-03-16 17:18:40 +01:00
computed: {
accountsFetcher: ({ $currentInstance, $accessToken }) => () => getFollowRequests($currentInstance, $accessToken)
2018-03-16 17:18:40 +01:00
},
store: () => store,
components: {
AccountsListPage,
DynamicPageBanner
}
}
</script>