const { execute: report, loading } = useReportPublication();
const handleSubmit = async () => {
const result = await report({
publicationId: publicationId('0x014e-0x0a'),
reason: PublicationReportReason.FAKE_ENGAGEMENT,
additionalComments: 'Human readable comments, if any.',
});
if (result.isSuccess()) {
alert('Publication reported!');
}
};
<button onClick={handleSubmit} disabled={loading}>
Report
</button>
Report a publication for a given reason.
You MUST be authenticated via useLogin to use this hook.