aboutsummaryrefslogtreecommitdiff
path: root/src/components
diff options
context:
space:
mode:
Diffstat (limited to 'src/components')
-rw-r--r--src/components/follow_requests/follow_requests.js19
-rw-r--r--src/components/user_card/user_card.js2
2 files changed, 14 insertions, 7 deletions
diff --git a/src/components/follow_requests/follow_requests.js b/src/components/follow_requests/follow_requests.js
index 9fe4a57e..11a228aa 100644
--- a/src/components/follow_requests/follow_requests.js
+++ b/src/components/follow_requests/follow_requests.js
@@ -1,17 +1,22 @@
import UserCard from '../user_card/user_card.vue'
const FollowRequests = {
- data () {
- return {
- requests: []
- }
- },
components: {
UserCard
},
created () {
- this.$store.state.api.backendInteractor.fetchFollowRequests()
- .then((requests) => { this.requests = requests })
+ this.updateRequests()
+ },
+ computed: {
+ requests () {
+ return this.$store.state.api.followRequests
+ }
+ },
+ methods: {
+ updateRequests () {
+ this.$store.state.api.backendInteractor.fetchFollowRequests()
+ .then((requests) => { this.$store.commit('setFollowRequests', requests) })
+ }
}
}
diff --git a/src/components/user_card/user_card.js b/src/components/user_card/user_card.js
index f47df0eb..a019627a 100644
--- a/src/components/user_card/user_card.js
+++ b/src/components/user_card/user_card.js
@@ -20,9 +20,11 @@ const UserCard = {
},
approveUser () {
this.$store.state.api.backendInteractor.approveUser(this.user.id)
+ this.$store.dispatch('removeFollowRequest', this.user)
},
denyUser () {
this.$store.state.api.backendInteractor.denyUser(this.user.id)
+ this.$store.dispatch('removeFollowRequest', this.user)
}
}
}