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

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

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 };
});