上限をつけたりした

Signed-off-by: mattyatea <mattyacocacora0@gmail.com>
This commit is contained in:
mattyatea 2024-01-04 23:05:07 +09:00
parent c6cccd791d
commit 334894f7bf
No known key found for this signature in database
GPG key ID: 068E54E2C33BEF9A
2 changed files with 4 additions and 2 deletions

View file

@ -34,7 +34,7 @@ export class AbuseUserReportEntityService {
src: MiAbuseUserReport['id'] | MiAbuseUserReport,
) {
const report = typeof src === 'object' ? src : await this.abuseUserReportsRepository.findOneByOrFail({ id: src });
const notes = (report.notes.length === 0) ? report.notes : [];
const notes = [];
if (report.noteIds && report.noteIds.length > 0) {
for (const x of report.noteIds) {
@ -45,6 +45,8 @@ export class AbuseUserReportEntityService {
}
notes.push(await this.noteEntityService.pack(x));
}
} else if (report.notes.length > 0) {
notes.push(...(report.notes));
}
console.log(report.notes.length, null, notes);

View file

@ -53,7 +53,7 @@ export const paramDef = {
properties: {
userId: { type: 'string', format: 'misskey:id' },
comment: { type: 'string', minLength: 1, maxLength: 2048 },
noteIds: { type: 'array', items: { type: 'string', format: 'misskey:id' } },
noteIds: { type: 'array', items: { type: 'string', format: 'misskey:id', maxLength: 16 } },
},
required: ['userId', 'comment'],
} as const;