server: return report id when reporting
ci/woodpecker/push/lint-foundkey-js Pipeline failed Details
ci/woodpecker/push/lint-sw Pipeline failed Details
ci/woodpecker/push/lint-client Pipeline failed Details
ci/woodpecker/push/build Pipeline failed Details
ci/woodpecker/push/test unknown status Details
ci/woodpecker/push/lint-backend Pipeline failed Details

This can be useful when adding a feature for admins and moderators
where they will be able to immediately deal with their own report,
i.e. forwarding it to the other instance.

Changelog: Added
This commit is contained in:
Johann150 2024-02-19 08:19:23 +01:00
parent fba8536743
commit d4a5ed29db
Signed by: Johann150
GPG Key ID: 9EE6577A2A06F8F1
1 changed files with 16 additions and 0 deletions

View File

@ -16,6 +16,20 @@ export const meta = {
description: 'File a report.',
res: {
type: 'object',
optional: false,
required: true,
properties: {
id: {
type: 'string',
format: 'misskey:id',
optional: false,
nullable: false,
},
}
}
errors: ['NO_SUCH_USER', 'CANNOT_REPORT_ADMIN', 'CANNOT_REPORT_YOURSELF'],
} as const;
@ -81,4 +95,6 @@ export default define(meta, paramDef, async (ps, me) => {
sanitizeHtml(ps.comment));
}
});
return { id: report.id };
});