fix: admin unread only reversed
This commit is contained in:
3 files changed
+33
-31
No files matched your search
@@ -1,14 +1,14 @@
|
||||
import { getClient } from '$lib/api/client.svelte'
|
||||
import { client } from '$lib/api/client.svelte'
|
||||
import { ReactiveState } from '$lib/app/util.svelte'
|
||||
|
||||
export async function load({ fetch, url }) {
|
||||
const page = Number(url.searchParams.get('page')) || 1
|
||||
const type = url.searchParams.get('type') || 'unread'
|
||||
|
||||
const res = await getClient(undefined, fetch).listRegistrationApplications({
|
||||
const res = await client({ func: fetch }).listRegistrationApplications({
|
||||
page: page,
|
||||
limit: 40,
|
||||
unread_only: type == 'all',
|
||||
unread_only: type == 'unread',
|
||||
})
|
||||
|
||||
return {
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
import ApplicationDenyModal from '$lib/feature/moderation/ApplicationDenyModal.svelte'
|
||||
import UserLink from '$lib/feature/user/UserLink.svelte'
|
||||
import { publishedToDate } from '$lib/ui/util/date'
|
||||
import { Button, Label, Material, toast } from 'mono-svelte'
|
||||
import { Button, ButtonGroup, Label, Material, toast } from 'mono-svelte'
|
||||
import RelativeDate from 'mono-svelte/util/RelativeDate.svelte'
|
||||
import {
|
||||
Check,
|
||||
@@ -157,29 +157,31 @@
|
||||
{/if}
|
||||
</div>
|
||||
<div class="flex-1"></div>
|
||||
<Button
|
||||
size="square-md"
|
||||
class="hover:bg-slate-200 {application.creator_local_user
|
||||
.accepted_application === false && application.admin
|
||||
? 'text-red-500!'
|
||||
: ''}"
|
||||
aria-label={$t('routes.admin.applications.deny')}
|
||||
onclick={() => review(false)}
|
||||
loading={denying || reviewing}
|
||||
disabled={approving || denying || reviewing}
|
||||
icon={XMark}
|
||||
></Button>
|
||||
<Button
|
||||
size="square-md"
|
||||
class="hover:bg-slate-200 {application.creator_local_user
|
||||
.accepted_application
|
||||
? 'text-green-500!'
|
||||
: ''}"
|
||||
title={$t('routes.admin.applications.approve')}
|
||||
onclick={() => review(true)}
|
||||
loading={approving}
|
||||
disabled={approving || denying || reviewing}
|
||||
icon={Check}
|
||||
></Button>
|
||||
<ButtonGroup orientation="horizontal" class="flex">
|
||||
<Button
|
||||
size="square-md"
|
||||
class="hover:bg-slate-200 {application.creator_local_user
|
||||
.accepted_application === false && application.admin
|
||||
? 'text-red-500!'
|
||||
: ''}"
|
||||
aria-label={$t('routes.admin.applications.deny')}
|
||||
onclick={() => review(false)}
|
||||
loading={denying || reviewing}
|
||||
disabled={approving || denying || reviewing}
|
||||
icon={XMark}
|
||||
></Button>
|
||||
<Button
|
||||
size="square-md"
|
||||
class="hover:bg-slate-200 {application.creator_local_user
|
||||
.accepted_application
|
||||
? 'text-green-500!'
|
||||
: ''}"
|
||||
title={$t('routes.admin.applications.approve')}
|
||||
onclick={() => review(true)}
|
||||
loading={approving}
|
||||
disabled={approving || denying || reviewing}
|
||||
icon={Check}
|
||||
></Button>
|
||||
</ButtonGroup>
|
||||
</div>
|
||||
</Material>
|
||||
@@ -29,8 +29,6 @@ export async function load({ url, fetch }) {
|
||||
community_id: community,
|
||||
}
|
||||
|
||||
const admin = profile.isAdmin
|
||||
|
||||
const [posts, comments, messages] = await Promise.all([
|
||||
client.listPostReports({
|
||||
...params,
|
||||
@@ -38,7 +36,9 @@ export async function load({ url, fetch }) {
|
||||
client.listCommentReports({
|
||||
...params,
|
||||
}),
|
||||
admin ? client.listPrivateMessageReports({ ...params }) : undefined,
|
||||
profile.isAdmin
|
||||
? client.listPrivateMessageReports({ ...params })
|
||||
: undefined,
|
||||
])
|
||||
|
||||
const everything = [
|
||||
|
||||
Reference in new issue
Block a user