fix: admin unread only reversed
This commit is contained in:
3 files changed
+9
-7
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'
|
import { ReactiveState } from '$lib/app/util.svelte'
|
||||||
|
|
||||||
export async function load({ fetch, url }) {
|
export async function load({ fetch, url }) {
|
||||||
const page = Number(url.searchParams.get('page')) || 1
|
const page = Number(url.searchParams.get('page')) || 1
|
||||||
const type = url.searchParams.get('type') || 'unread'
|
const type = url.searchParams.get('type') || 'unread'
|
||||||
|
|
||||||
const res = await getClient(undefined, fetch).listRegistrationApplications({
|
const res = await client({ func: fetch }).listRegistrationApplications({
|
||||||
page: page,
|
page: page,
|
||||||
limit: 40,
|
limit: 40,
|
||||||
unread_only: type == 'all',
|
unread_only: type == 'unread',
|
||||||
})
|
})
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
import ApplicationDenyModal from '$lib/feature/moderation/ApplicationDenyModal.svelte'
|
import ApplicationDenyModal from '$lib/feature/moderation/ApplicationDenyModal.svelte'
|
||||||
import UserLink from '$lib/feature/user/UserLink.svelte'
|
import UserLink from '$lib/feature/user/UserLink.svelte'
|
||||||
import { publishedToDate } from '$lib/ui/util/date'
|
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 RelativeDate from 'mono-svelte/util/RelativeDate.svelte'
|
||||||
import {
|
import {
|
||||||
Check,
|
Check,
|
||||||
@@ -157,6 +157,7 @@
|
|||||||
{/if}
|
{/if}
|
||||||
</div>
|
</div>
|
||||||
<div class="flex-1"></div>
|
<div class="flex-1"></div>
|
||||||
|
<ButtonGroup orientation="horizontal" class="flex">
|
||||||
<Button
|
<Button
|
||||||
size="square-md"
|
size="square-md"
|
||||||
class="hover:bg-slate-200 {application.creator_local_user
|
class="hover:bg-slate-200 {application.creator_local_user
|
||||||
@@ -181,5 +182,6 @@
|
|||||||
disabled={approving || denying || reviewing}
|
disabled={approving || denying || reviewing}
|
||||||
icon={Check}
|
icon={Check}
|
||||||
></Button>
|
></Button>
|
||||||
|
</ButtonGroup>
|
||||||
</div>
|
</div>
|
||||||
</Material>
|
</Material>
|
||||||
@@ -29,8 +29,6 @@ export async function load({ url, fetch }) {
|
|||||||
community_id: community,
|
community_id: community,
|
||||||
}
|
}
|
||||||
|
|
||||||
const admin = profile.isAdmin
|
|
||||||
|
|
||||||
const [posts, comments, messages] = await Promise.all([
|
const [posts, comments, messages] = await Promise.all([
|
||||||
client.listPostReports({
|
client.listPostReports({
|
||||||
...params,
|
...params,
|
||||||
@@ -38,7 +36,9 @@ export async function load({ url, fetch }) {
|
|||||||
client.listCommentReports({
|
client.listCommentReports({
|
||||||
...params,
|
...params,
|
||||||
}),
|
}),
|
||||||
admin ? client.listPrivateMessageReports({ ...params }) : undefined,
|
profile.isAdmin
|
||||||
|
? client.listPrivateMessageReports({ ...params })
|
||||||
|
: undefined,
|
||||||
])
|
])
|
||||||
|
|
||||||
const everything = [
|
const everything = [
|
||||||
|
|||||||
Reference in new issue
Block a user