movedTo(Uri), alsoKnownAsはユーザーidを返すように
This commit is contained in:
parent
eb4bca83fd
commit
3d88a91f61
7 changed files with 51 additions and 16 deletions
|
|
@ -369,8 +369,11 @@ export class UserEntityService implements OnModuleInit {
|
|||
...(opts.detail ? {
|
||||
url: profile!.url,
|
||||
uri: user.uri,
|
||||
movedToUri: user.movedToUri ? this.apPersonService.resolvePerson(user.movedToUri).then(user => user.uri).catch(() => null) : null,
|
||||
alsoKnownAs: user.alsoKnownAs,
|
||||
movedTo: user.movedToUri ? this.apPersonService.resolvePerson(user.movedToUri).then(user => user.id).catch(() => null) : null,
|
||||
alsoKnownAs: user.alsoKnownAs
|
||||
? Promise.all(user.alsoKnownAs.map(uri => this.apPersonService.fetchPerson(uri).then(user => user?.id).catch(() => null)))
|
||||
.then(xs => xs.length === 0 ? null : xs.filter(x => x != null) as string[])
|
||||
: null,
|
||||
createdAt: user.createdAt.toISOString(),
|
||||
updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null,
|
||||
lastFetchedAt: user.lastFetchedAt ? user.lastFetchedAt.toISOString() : null,
|
||||
|
|
|
|||
|
|
@ -80,9 +80,12 @@ export const packedUserDetailedNotMeOnlySchema = {
|
|||
},
|
||||
alsoKnownAs: {
|
||||
type: 'array',
|
||||
format: 'uri',
|
||||
nullable: true,
|
||||
optional: false,
|
||||
items: {
|
||||
type: 'string',
|
||||
format: 'id',
|
||||
},
|
||||
},
|
||||
createdAt: {
|
||||
type: 'string',
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue