mirror of
https://git.joinsharkey.org/Sharkey/Sharkey.git
synced 2024-11-05 16:53:09 +02:00
chore: lint on SkApprovalUser
This commit is contained in:
parent
fd8fa9b3de
commit
537af45e71
1 changed files with 11 additions and 11 deletions
|
@ -19,8 +19,8 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div :class="$style.buttons">
|
<div :class="$style.buttons">
|
||||||
<MkButton inline success @click="approveAccount(user)">{{ i18n.ts.approveAccount }}</MkButton>
|
<MkButton inline success @click="approveAccount()">{{ i18n.ts.approveAccount }}</MkButton>
|
||||||
<MkButton inline danger @click="deleteAccount(user)">{{ i18n.ts.denyAccount }}</MkButton>
|
<MkButton inline danger @click="deleteAccount()">{{ i18n.ts.denyAccount }}</MkButton>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</MkFolder>
|
</MkFolder>
|
||||||
|
@ -54,7 +54,7 @@ const emits = defineEmits<{
|
||||||
(event: 'deleted', value: string): void;
|
(event: 'deleted', value: string): void;
|
||||||
}>();
|
}>();
|
||||||
|
|
||||||
async function deleteAccount(user) {
|
async function deleteAccount() {
|
||||||
const confirm = await os.confirm({
|
const confirm = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: i18n.ts.deleteAccountConfirm,
|
text: i18n.ts.deleteAccountConfirm,
|
||||||
|
@ -62,15 +62,15 @@ async function deleteAccount(user) {
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
|
|
||||||
const typed = await os.inputText({
|
const typed = await os.inputText({
|
||||||
text: i18n.t('typeToConfirm', { x: user?.username }),
|
text: i18n.t('typeToConfirm', { x: props.user.username }),
|
||||||
});
|
});
|
||||||
if (typed.canceled) return;
|
if (typed.canceled) return;
|
||||||
|
|
||||||
if (typed.result === user?.username) {
|
if (typed.result === props.user.username) {
|
||||||
await os.apiWithDialog('admin/delete-account', {
|
await os.apiWithDialog('admin/delete-account', {
|
||||||
userId: user.id,
|
userId: props.user.id,
|
||||||
});
|
});
|
||||||
emits('deleted', user.id);
|
emits('deleted', props.user.id);
|
||||||
} else {
|
} else {
|
||||||
os.alert({
|
os.alert({
|
||||||
type: 'error',
|
type: 'error',
|
||||||
|
@ -79,14 +79,14 @@ async function deleteAccount(user) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async function approveAccount(user) {
|
async function approveAccount() {
|
||||||
const confirm = await os.confirm({
|
const confirm = await os.confirm({
|
||||||
type: 'warning',
|
type: 'warning',
|
||||||
text: i18n.ts.approveConfirm,
|
text: i18n.ts.approveConfirm,
|
||||||
});
|
});
|
||||||
if (confirm.canceled) return;
|
if (confirm.canceled) return;
|
||||||
await os.api('admin/approve-user', { userId: user.id });
|
await os.api('admin/approve-user', { userId: props.user.id });
|
||||||
emits('deleted', user.id);
|
emits('deleted', props.user.id);
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue