enhance(frontend): 「今日誕生日のフォロー中ユーザー」ウィジェットをリファクタリング

This commit is contained in:
まっちゃとーにゅ 2024-03-29 02:28:22 +09:00
parent 9723d01277
commit 24652b9364
No known key found for this signature in database
GPG key ID: 6AFBBF529601C1DB
18 changed files with 434 additions and 94 deletions

View file

@ -27,10 +27,21 @@ export const meta = {
res: {
optional: false, nullable: false,
oneOf: [
{
type: 'object',
ref: 'UserLite',
},
{
type: 'object',
ref: 'UserDetailed',
},
{
type: 'array',
items: {
type: 'object',
ref: 'UserLite',
},
},
{
type: 'array',
items: {
@ -71,6 +82,7 @@ export const paramDef = {
nullable: true,
description: 'The local host is represented with `null`.',
},
detailed: { type: 'boolean', default: true },
},
anyOf: [
{ required: ['userId'] },
@ -117,7 +129,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
return await this.userEntityService.packMany(_users, me, {
schema: 'UserDetailed',
schema: ps.detailed ? 'UserDetailed' : 'UserLite',
});
} else {
// Lookup user
@ -147,7 +159,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
}
return await this.userEntityService.pack(user, me, {
schema: 'UserDetailed',
schema: ps.detailed ? 'UserDetailed' : 'UserLite',
});
}
});