Refactor & Clean up

This commit is contained in:
syuilo
2018-11-09 08:13:34 +09:00
parent ba845f5218
commit 60ef3e3563
154 changed files with 438 additions and 481 deletions

View File

@@ -67,13 +67,13 @@ export default Vue.extend({
this.verifying = true;
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.verifyUsername));
await (this as any).os.api('admin/verify-user', { userId: user.id });
//(this as any).os.apis.dialog({ text: this.$t('verified') });
const user = await this.$root.os.api('users/show', parseAcct(this.verifyUsername));
await this.$root.os.api('admin/verify-user', { userId: user.id });
//this.$root.os.apis.dialog({ text: this.$t('verified') });
};
await process().catch(e => {
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
});
this.verifying = false;
@@ -83,13 +83,13 @@ export default Vue.extend({
this.unverifying = true;
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.unverifyUsername));
await (this as any).os.api('admin/unverify-user', { userId: user.id });
//(this as any).os.apis.dialog({ text: this.$t('unverified') });
const user = await this.$root.os.api('users/show', parseAcct(this.unverifyUsername));
await this.$root.os.api('admin/unverify-user', { userId: user.id });
//this.$root.os.apis.dialog({ text: this.$t('unverified') });
};
await process().catch(e => {
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
});
this.unverifying = false;
@@ -99,13 +99,13 @@ export default Vue.extend({
this.suspending = true;
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.suspendUsername));
await (this as any).os.api('admin/suspend-user', { userId: user.id });
//(this as any).os.apis.dialog({ text: this.$t('suspended') });
const user = await this.$root.os.api('users/show', parseAcct(this.suspendUsername));
await this.$root.os.api('admin/suspend-user', { userId: user.id });
//this.$root.os.apis.dialog({ text: this.$t('suspended') });
};
await process().catch(e => {
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
});
this.suspending = false;
@@ -115,13 +115,13 @@ export default Vue.extend({
this.unsuspending = true;
const process = async () => {
const user = await (this as any).os.api('users/show', parseAcct(this.unsuspendUsername));
await (this as any).os.api('admin/unsuspend-user', { userId: user.id });
//(this as any).os.apis.dialog({ text: this.$t('unsuspended') });
const user = await this.$root.os.api('users/show', parseAcct(this.unsuspendUsername));
await this.$root.os.api('admin/unsuspend-user', { userId: user.id });
//this.$root.os.apis.dialog({ text: this.$t('unsuspended') });
};
await process().catch(e => {
//(this as any).os.apis.dialog({ text: `Failed: ${e}` });
//this.$root.os.apis.dialog({ text: `Failed: ${e}` });
});
this.unsuspending = false;