users store unit tests
This commit is contained in:
parent
24b0f98ef0
commit
975b338586
16 changed files with 1804 additions and 727 deletions
|
|
@ -1,11 +1,8 @@
|
|||
import { defineAsyncComponent } from 'vue'
|
||||
|
||||
import {
|
||||
requestFollow,
|
||||
requestUnfollow,
|
||||
} from '../../services/follow_manipulate/follow_manipulate'
|
||||
|
||||
import { useMergedConfigStore } from 'src/stores/merged_config.js'
|
||||
import { useUsersStore } from 'src/stores/users.js'
|
||||
|
||||
export default {
|
||||
props: ['relationship', 'user', 'labelFollowing', 'buttonClass'],
|
||||
components: {
|
||||
|
|
@ -64,9 +61,11 @@ export default {
|
|||
},
|
||||
follow() {
|
||||
this.inProgress = true
|
||||
requestFollow(this.relationship.id, this.$store).then(() => {
|
||||
this.inProgress = false
|
||||
})
|
||||
useUsersStore()
|
||||
.followUser(this.relationship.id)
|
||||
.then(() => {
|
||||
this.inProgress = false
|
||||
})
|
||||
},
|
||||
unfollow() {
|
||||
if (this.shouldConfirmUnfollow) {
|
||||
|
|
@ -78,13 +77,15 @@ export default {
|
|||
doUnfollow() {
|
||||
const store = this.$store
|
||||
this.inProgress = true
|
||||
requestUnfollow(this.relationship.id, store).then(() => {
|
||||
this.inProgress = false
|
||||
store.commit('removeStatus', {
|
||||
timeline: 'friends',
|
||||
userId: this.relationship.id,
|
||||
useUsersStore()
|
||||
.unfollowUser(this.relationship.id)
|
||||
.then(() => {
|
||||
this.inProgress = false
|
||||
store.commit('removeStatus', {
|
||||
timeline: 'friends',
|
||||
userId: this.relationship.id,
|
||||
})
|
||||
})
|
||||
})
|
||||
|
||||
this.hideConfirmUnfollow()
|
||||
},
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue