appeal mod service header

This commit is contained in:
Hailey
2025-09-11 00:24:49 -07:00
parent 58ffe365ae
commit 6f42858ce3
+11 -3
View File
@@ -9,7 +9,10 @@ import {useLingui} from '@lingui/react'
import {useMutation} from '@tanstack/react-query' import {useMutation} from '@tanstack/react-query'
import Graphemer from 'graphemer' import Graphemer from 'graphemer'
import {MAX_REPORT_REASON_GRAPHEME_LENGTH} from '#/lib/constants' import {
BLUESKY_MOD_SERVICE_HEADERS,
MAX_REPORT_REASON_GRAPHEME_LENGTH,
} from '#/lib/constants'
import {useEnableKeyboardController} from '#/lib/hooks/useEnableKeyboardController' import {useEnableKeyboardController} from '#/lib/hooks/useEnableKeyboardController'
import {cleanError} from '#/lib/strings/errors' import {cleanError} from '#/lib/strings/errors'
import {isIOS, isWeb} from '#/platform/detection' import {isIOS, isWeb} from '#/platform/detection'
@@ -49,14 +52,19 @@ export function Takendown() {
} = useMutation({ } = useMutation({
mutationFn: async (appealText: string) => { mutationFn: async (appealText: string) => {
if (!currentAccount) throw new Error('No session') if (!currentAccount) throw new Error('No session')
await agent.com.atproto.moderation.createReport({ await agent.com.atproto.moderation.createReport(
{
reasonType: ComAtprotoModerationDefs.REASONAPPEAL, reasonType: ComAtprotoModerationDefs.REASONAPPEAL,
subject: { subject: {
$type: 'com.atproto.admin.defs#repoRef', $type: 'com.atproto.admin.defs#repoRef',
did: currentAccount.did, did: currentAccount.did,
} satisfies ComAtprotoAdminDefs.RepoRef, } satisfies ComAtprotoAdminDefs.RepoRef,
reason: appealText, reason: appealText,
}) },
{
headers: BLUESKY_MOD_SERVICE_HEADERS,
},
)
}, },
onSuccess: () => setReason(''), onSuccess: () => setReason(''),
}) })