mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-12-24 19:43:09 +02:00
[Client] Fix bugs
This commit is contained in:
parent
56d571c0f0
commit
0985f7f609
2 changed files with 42 additions and 17 deletions
|
@ -43,7 +43,7 @@ export default Vue.extend({
|
||||||
await process().catch(e => {
|
await process().catch(e => {
|
||||||
this.$root.alert({
|
this.$root.alert({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
text: e
|
text: e.toString()
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -49,6 +49,7 @@ import parseAcct from "../../../../misc/acct/parse";
|
||||||
|
|
||||||
export default Vue.extend({
|
export default Vue.extend({
|
||||||
i18n: i18n('admin/views/users.vue'),
|
i18n: i18n('admin/views/users.vue'),
|
||||||
|
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
verifyUsername: null,
|
verifyUsername: null,
|
||||||
|
@ -67,13 +68,19 @@ export default Vue.extend({
|
||||||
this.verifying = true;
|
this.verifying = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
const user = await this.$root.os.api('users/show', parseAcct(this.verifyUsername));
|
const user = await this.$root.api('users/show', parseAcct(this.verifyUsername));
|
||||||
await this.$root.os.api('admin/verify-user', { userId: user.id });
|
await this.$root.api('admin/verify-user', { userId: user.id });
|
||||||
//this.$root.os.apis.dialog({ text: this.$t('verified') });
|
this.$root.alert({
|
||||||
|
type: 'success',
|
||||||
|
text: this.$t('verified')
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
await process().catch(e => {
|
await process().catch(e => {
|
||||||
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
|
this.$root.alert({
|
||||||
|
type: 'error',
|
||||||
|
text: e.toString()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.verifying = false;
|
this.verifying = false;
|
||||||
|
@ -83,13 +90,19 @@ export default Vue.extend({
|
||||||
this.unverifying = true;
|
this.unverifying = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
const user = await this.$root.os.api('users/show', parseAcct(this.unverifyUsername));
|
const user = await this.$root.api('users/show', parseAcct(this.unverifyUsername));
|
||||||
await this.$root.os.api('admin/unverify-user', { userId: user.id });
|
await this.$root.api('admin/unverify-user', { userId: user.id });
|
||||||
//this.$root.os.apis.dialog({ text: this.$t('unverified') });
|
this.$root.alert({
|
||||||
|
type: 'success',
|
||||||
|
text: this.$t('unverified')
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
await process().catch(e => {
|
await process().catch(e => {
|
||||||
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
|
this.$root.alert({
|
||||||
|
type: 'error',
|
||||||
|
text: e.toString()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.unverifying = false;
|
this.unverifying = false;
|
||||||
|
@ -99,13 +112,19 @@ export default Vue.extend({
|
||||||
this.suspending = true;
|
this.suspending = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
const user = await this.$root.os.api('users/show', parseAcct(this.suspendUsername));
|
const user = await this.$root.api('users/show', parseAcct(this.suspendUsername));
|
||||||
await this.$root.os.api('admin/suspend-user', { userId: user.id });
|
await this.$root.api('admin/suspend-user', { userId: user.id });
|
||||||
//this.$root.os.apis.dialog({ text: this.$t('suspended') });
|
this.$root.alert({
|
||||||
|
type: 'success',
|
||||||
|
text: this.$t('suspended')
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
await process().catch(e => {
|
await process().catch(e => {
|
||||||
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
|
this.$root.alert({
|
||||||
|
type: 'error',
|
||||||
|
text: e.toString()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.suspending = false;
|
this.suspending = false;
|
||||||
|
@ -115,13 +134,19 @@ export default Vue.extend({
|
||||||
this.unsuspending = true;
|
this.unsuspending = true;
|
||||||
|
|
||||||
const process = async () => {
|
const process = async () => {
|
||||||
const user = await this.$root.os.api('users/show', parseAcct(this.unsuspendUsername));
|
const user = await this.$root.api('users/show', parseAcct(this.unsuspendUsername));
|
||||||
await this.$root.os.api('admin/unsuspend-user', { userId: user.id });
|
await this.$root.api('admin/unsuspend-user', { userId: user.id });
|
||||||
//this.$root.os.apis.dialog({ text: this.$t('unsuspended') });
|
this.$root.alert({
|
||||||
|
type: 'success',
|
||||||
|
text: this.$t('unsuspended')
|
||||||
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
await process().catch(e => {
|
await process().catch(e => {
|
||||||
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
|
this.$root.alert({
|
||||||
|
type: 'error',
|
||||||
|
text: e.toString()
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
this.unsuspending = false;
|
this.unsuspending = false;
|
||||||
|
|
Loading…
Reference in a new issue