move mandatoryCW from admin-user to PackedUserLite (public field)

This commit is contained in:
Hazelnoot 2025-02-12 14:42:24 -05:00
parent 6c2034a373
commit c5933f369e
5 changed files with 7 additions and 6 deletions

View file

@ -592,6 +592,7 @@ export class UserEntityService implements OnModuleInit {
isCat: user.isCat,
noindex: user.noindex,
enableRss: user.enableRss,
mandatoryCW: user.mandatoryCW,
isSilenced: user.isSilenced || this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
speakAsCat: user.speakAsCat ?? false,
approved: user.approved,

View file

@ -134,6 +134,10 @@ export const packedUserLiteSchema = {
type: 'boolean',
nullable: false, optional: false,
},
mandatoryCW: {
type: 'string',
nullable: true, optional: false,
},
isBot: {
type: 'boolean',
nullable: false, optional: true,

View file

@ -144,10 +144,6 @@ export const meta = {
type: 'string',
optional: false, nullable: false,
},
mandatoryCW: {
type: 'string',
optional: false, nullable: true,
},
signins: {
type: 'array',
optional: false, nullable: false,
@ -264,7 +260,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
isHibernated: user.isHibernated,
lastActiveDate: user.lastActiveDate ? user.lastActiveDate.toISOString() : null,
moderationNote: profile.moderationNote ?? '',
mandatoryCW: user.mandatoryCW,
signins,
policies: await this.roleService.getUserPolicies(user.id),
roles: await this.roleEntityService.packMany(roles, me),