forked from AkkomaGang/admin-fe
Add ability to change actor type from moderation dropdown
This commit is contained in:
parent
a5ab8ceb47
commit
a55b76208e
2 changed files with 22 additions and 10 deletions
|
@ -16,7 +16,8 @@ import {
|
||||||
forcePasswordReset,
|
forcePasswordReset,
|
||||||
approveUserAccount,
|
approveUserAccount,
|
||||||
confirmUserEmail,
|
confirmUserEmail,
|
||||||
resendConfirmationEmail
|
resendConfirmationEmail,
|
||||||
|
updateUserCredentials
|
||||||
} from '@/api/users'
|
} from '@/api/users'
|
||||||
|
|
||||||
const users = {
|
const users = {
|
||||||
|
@ -277,6 +278,15 @@ const users = {
|
||||||
const currentFilters = { ...defaultFilters, ...filters }
|
const currentFilters = { ...defaultFilters, ...filters }
|
||||||
commit('SET_USERS_FILTERS', currentFilters)
|
commit('SET_USERS_FILTERS', currentFilters)
|
||||||
dispatch('SearchUsers', { query: state.searchQuery, page: 1 })
|
dispatch('SearchUsers', { query: state.searchQuery, page: 1 })
|
||||||
|
},
|
||||||
|
async UpdateActorType({ dispatch, getters }, { user, type, _userId, _statusId }) {
|
||||||
|
const updatedUsers = [{ ...user, actor_type: type }]
|
||||||
|
const nickname = [user.nickname]
|
||||||
|
const credentials = { actor_type: type }
|
||||||
|
|
||||||
|
const callApiFn = async() => await updateUserCredentials(nickname, credentials, getters.authHost, getters.token)
|
||||||
|
|
||||||
|
dispatch('ApplyChanges', { updatedUsers, callApiFn, userId: _userId, statusId: _statusId })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -17,11 +17,10 @@
|
||||||
</div>
|
</div>
|
||||||
<el-dropdown-menu slot="dropdown">
|
<el-dropdown-menu slot="dropdown">
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
class="actor-type-dropdown"
|
class="actor-type-dropdown">
|
||||||
@click.native="getPasswordResetToken(user.nickname)">
|
|
||||||
<el-select v-model="actorType" placeholder="Actor Type" class="actor-type-select">
|
<el-select v-model="actorType" placeholder="Actor Type" class="actor-type-select">
|
||||||
<el-option label="Bot" value="bot"/>
|
<el-option value="Service"/>
|
||||||
<el-option label="Person" value="person"/>
|
<el-option value="Person"/>
|
||||||
</el-select>
|
</el-select>
|
||||||
</el-dropdown-item>
|
</el-dropdown-item>
|
||||||
<el-dropdown-item
|
<el-dropdown-item
|
||||||
|
@ -146,12 +145,15 @@ export default {
|
||||||
default: ''
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
|
||||||
return {
|
|
||||||
actorType: ''
|
|
||||||
}
|
|
||||||
},
|
|
||||||
computed: {
|
computed: {
|
||||||
|
actorType: {
|
||||||
|
get() {
|
||||||
|
return this.user.actor_type
|
||||||
|
},
|
||||||
|
set(type) {
|
||||||
|
this.$store.dispatch('UpdateActorType', { user: this.user, type })
|
||||||
|
}
|
||||||
|
},
|
||||||
isDesktop() {
|
isDesktop() {
|
||||||
return this.$store.state.app.device === 'desktop'
|
return this.$store.state.app.device === 'desktop'
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue