forked from FoundKeyGang/FoundKey
client: moderators can immmediately forward reports
Changelog: Added
This commit is contained in:
parent
76aef3de74
commit
f751941a30
1 changed files with 20 additions and 0 deletions
|
@ -17,6 +17,8 @@
|
|||
</div>
|
||||
<div class="_section">
|
||||
<MkButton primary full :disabled="comment.length === 0" @click="send">{{ i18n.ts.send }}</MkButton>
|
||||
<MkButton v-if="iAmModerator" full :disabled="comment.length === 0" @click="forward">{{ i18n.ts.forwardReport }}</MkButton>
|
||||
<p>{{ i18n.ts.forwardReportIsAnonymous }}</p>
|
||||
</div>
|
||||
</div>
|
||||
</XWindow>
|
||||
|
@ -25,7 +27,9 @@
|
|||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
import * as foundkey from 'foundkey-js';
|
||||
import { iAmModerator } from '@/account';
|
||||
import XWindow from '@/components/ui/window.vue';
|
||||
import FormSwitch from '@/components/form/switch.vue';
|
||||
import FormTextarea from '@/components/form/textarea.vue';
|
||||
import MkButton from '@/components/ui/button.vue';
|
||||
import * as os from '@/os';
|
||||
|
@ -53,6 +57,22 @@ function send(): void {
|
|||
emit('closed');
|
||||
});
|
||||
}
|
||||
|
||||
function forward(): void {
|
||||
os.apiWithDialog('users/report-abuse', {
|
||||
userId: props.user.id,
|
||||
urls: props.urls || [],
|
||||
comment: comment.value,
|
||||
}).then((report) => {
|
||||
os.apiWithDialog('admin/reports/resolve', {
|
||||
reportId: report.id,
|
||||
forward: true,
|
||||
}).then(() => {
|
||||
uiWindow.value?.close();
|
||||
emit('closed');
|
||||
});
|
||||
});
|
||||
}
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
|
Loading…
Reference in a new issue