Skip to content

Commit

Permalink
chore: lint on SkApprovalUser
Browse files Browse the repository at this point in the history
  • Loading branch information
Mar0xy authored and kakkokari-gtyih committed Dec 29, 2023
1 parent 38616fe commit 9606165
Showing 1 changed file with 11 additions and 11 deletions.
22 changes: 11 additions & 11 deletions packages/frontend/src/components/SkApprovalUser.vue
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@
</div>
</div>
<div :class="$style.buttons">
<MkButton inline success @click="approveAccount(user)">{{ i18n.ts.approveAccount }}</MkButton>
<MkButton inline danger @click="deleteAccount(user)">{{ i18n.ts.denyAccount }}</MkButton>
<MkButton inline success @click="approveAccount()">{{ i18n.ts.approveAccount }}</MkButton>
<MkButton inline danger @click="deleteAccount()">{{ i18n.ts.denyAccount }}</MkButton>
</div>
</div>
</MkFolder>
Expand Down Expand Up @@ -54,23 +54,23 @@ const emits = defineEmits<{
(event: 'deleted', value: string): void;
}>();
async function deleteAccount(user) {
async function deleteAccount() {
const confirm = await os.confirm({
type: 'warning',
text: i18n.ts.deleteAccountConfirm,
});
if (confirm.canceled) return;
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.result === user?.username) {
if (typed.result === props.user.username) {
await os.apiWithDialog('admin/delete-account', {
userId: user.id,
userId: props.user.id,
});
emits('deleted', user.id);
emits('deleted', props.user.id);
} else {
os.alert({
type: 'error',
Expand All @@ -79,14 +79,14 @@ async function deleteAccount(user) {
}
}
async function approveAccount(user) {
async function approveAccount() {
const confirm = await os.confirm({
type: 'warning',
text: i18n.ts.approveConfirm,
});
if (confirm.canceled) return;
await os.api('admin/approve-user', { userId: user.id });
emits('deleted', user.id);
await os.api('admin/approve-user', { userId: props.user.id });
emits('deleted', props.user.id);
}
</script>

Expand All @@ -111,4 +111,4 @@ async function approveAccount(user) {
display: flex;
gap: 8px;
}
</style>
</style>

0 comments on commit 9606165

Please sign in to comment.