Make including followers in response a parameter

This commit is contained in:
PrivateGER 2024-10-07 16:23:24 +02:00
parent bfd812720e
commit 1c3495ef59
No known key found for this signature in database
GPG Key ID: 4AE9075DE407DCDA
3 changed files with 6 additions and 2 deletions

View File

@ -33,6 +33,7 @@ export const paramDef = {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
includeFollower: { type: 'boolean', default: false },
}, },
required: ['host'], required: ['host'],
} as const; } as const;
@ -54,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.limit(ps.limit) .limit(ps.limit)
.getMany(); .getMany();
return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: true }); return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: ps.includeFollower });
}); });
} }
} }

View File

@ -33,6 +33,7 @@ export const paramDef = {
sinceId: { type: 'string', format: 'misskey:id' }, sinceId: { type: 'string', format: 'misskey:id' },
untilId: { type: 'string', format: 'misskey:id' }, untilId: { type: 'string', format: 'misskey:id' },
limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 }, limit: { type: 'integer', minimum: 1, maximum: 100, default: 10 },
includeFollower: { type: 'boolean', default: false },
}, },
required: ['host'], required: ['host'],
} as const; } as const;
@ -54,7 +55,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
.limit(ps.limit) .limit(ps.limit)
.getMany(); .getMany();
return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: true }); return await this.followingEntityService.packMany(followings, me, { populateFollowee: true, populateFollower: ps.includeFollower });
}); });
} }
} }

View File

@ -220,6 +220,7 @@ const followingPagination = {
limit: 10, limit: 10,
params: { params: {
host: props.host, host: props.host,
includeFollower: true,
}, },
offsetMode: false, offsetMode: false,
}; };
@ -229,6 +230,7 @@ const followersPagination = {
limit: 10, limit: 10,
params: { params: {
host: props.host, host: props.host,
includeFollower: true,
}, },
offsetMode: false, offsetMode: false,
}; };