enhance(frontend): 「今日誕生日のフォロー中ユーザー」ウィジェットをリファクタリング
This commit is contained in:
parent
9723d01277
commit
24652b9364
18 changed files with 434 additions and 94 deletions
|
@ -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',
|
||||
});
|
||||
}
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue