move user.updateAt to UserLite

This commit is contained in:
Hazelnoot 2025-07-04 10:43:23 -04:00
parent 3dbfb4fa20
commit 69402e3abb
4 changed files with 9 additions and 8 deletions

View file

@ -443,6 +443,7 @@ export class WebhookTestService {
return {
...user,
createdAt: this.idService.parse(user.id).date.toISOString(),
updatedAt: null,
id: user.id,
name: user.name,
username: user.username,

View file

@ -546,6 +546,7 @@ export class UserEntityService implements OnModuleInit {
avatarBlurhash: (user.avatarId == null ? null : user.avatarBlurhash),
description: mastoapi ? mastoapi.description : profile ? profile.description : '',
createdAt: this.idService.parse(user.id).date.toISOString(),
updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null,
avatarDecorations: user.avatarDecorations.length > 0 ? this.avatarDecorationService.getAll().then(decorations => user.avatarDecorations.filter(ud => decorations.some(d => d.id === ud.id)).map(ud => ({
id: ud.id,
angle: ud.angle || undefined,
@ -601,7 +602,6 @@ export class UserEntityService implements OnModuleInit {
? Promise.all(user.alsoKnownAs.map(uri => Promise.resolve(opts.userIdsByUri?.get(uri) ?? this.apPersonService.fetchPerson(uri).then(user => user?.id).catch(() => null))))
.then(xs => xs.length === 0 ? null : xs.filter(x => x != null))
: null,
updatedAt: user.updatedAt ? user.updatedAt.toISOString() : null,
lastFetchedAt: user.lastFetchedAt ? user.lastFetchedAt.toISOString() : null,
bannerUrl: user.bannerId == null ? null : user.bannerUrl,
bannerBlurhash: user.bannerId == null ? null : user.bannerBlurhash,

View file

@ -69,6 +69,11 @@ export const packedUserLiteSchema = {
nullable: false, optional: false,
format: 'date-time',
},
updatedAt: {
type: 'string',
nullable: true, optional: false,
format: 'date-time',
},
approved: {
type: 'boolean',
nullable: false, optional: false,
@ -304,11 +309,6 @@ export const packedUserDetailedNotMeOnlySchema = {
nullable: false, optional: false,
},
},
updatedAt: {
type: 'string',
nullable: true, optional: false,
format: 'date-time',
},
lastFetchedAt: {
type: 'string',
nullable: true, optional: false,

View file

@ -4254,6 +4254,8 @@ export type components = {
host: string | null;
/** Format: date-time */
createdAt: string;
/** Format: date-time */
updatedAt: string | null;
approved: boolean;
/** @example Hi masters, I am Ai! */
description: string | null;
@ -4321,8 +4323,6 @@ export type components = {
movedTo: string | null;
alsoKnownAs: string[] | null;
/** Format: date-time */
updatedAt: string | null;
/** Format: date-time */
lastFetchedAt: string | null;
/** Format: url */
bannerUrl: string | null;