mirror of
https://activitypub.software/TransFem-org/Sharkey.git
synced 2024-11-17 13:46:34 +01:00
40 lines
782 B
Vue
40 lines
782 B
Vue
|
<template>
|
||
|
<div>
|
||
|
<header>%i18n:@suspend-user%</header>
|
||
|
<input v-model="username"/>
|
||
|
<button @click="suspendUser" :disabled="suspending">%i18n:@suspend%</button>
|
||
|
</div>
|
||
|
</template>
|
||
|
|
||
|
<script lang="ts">
|
||
|
import Vue from "vue";
|
||
|
import parseAcct from "../../../../../../misc/acct/parse";
|
||
|
|
||
|
export default Vue.extend({
|
||
|
data() {
|
||
|
return {
|
||
|
username: null,
|
||
|
suspending: false
|
||
|
};
|
||
|
},
|
||
|
methods: {
|
||
|
async suspendUser() {
|
||
|
this.suspending = true;
|
||
|
|
||
|
const user = await (this as any).os.api(
|
||
|
"users/show",
|
||
|
parseAcct(this.username)
|
||
|
);
|
||
|
|
||
|
await (this as any).os.api("admin/suspend-user", {
|
||
|
userId: user.id
|
||
|
});
|
||
|
|
||
|
this.suspending = false;
|
||
|
|
||
|
(this as any).os.apis.dialog("%i18n:@suspended%");
|
||
|
}
|
||
|
}
|
||
|
});
|
||
|
</script>
|