move mandatoryCW
from admin-user to PackedUserLite (public field)
This commit is contained in:
parent
6c2034a373
commit
c5933f369e
5 changed files with 7 additions and 6 deletions
|
@ -592,6 +592,7 @@ export class UserEntityService implements OnModuleInit {
|
||||||
isCat: user.isCat,
|
isCat: user.isCat,
|
||||||
noindex: user.noindex,
|
noindex: user.noindex,
|
||||||
enableRss: user.enableRss,
|
enableRss: user.enableRss,
|
||||||
|
mandatoryCW: user.mandatoryCW,
|
||||||
isSilenced: user.isSilenced || this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
|
isSilenced: user.isSilenced || this.roleService.getUserPolicies(user.id).then(r => !r.canPublicNote),
|
||||||
speakAsCat: user.speakAsCat ?? false,
|
speakAsCat: user.speakAsCat ?? false,
|
||||||
approved: user.approved,
|
approved: user.approved,
|
||||||
|
|
|
@ -134,6 +134,10 @@ export const packedUserLiteSchema = {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: false,
|
nullable: false, optional: false,
|
||||||
},
|
},
|
||||||
|
mandatoryCW: {
|
||||||
|
type: 'string',
|
||||||
|
nullable: true, optional: false,
|
||||||
|
},
|
||||||
isBot: {
|
isBot: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
nullable: false, optional: true,
|
nullable: false, optional: true,
|
||||||
|
|
|
@ -144,10 +144,6 @@ export const meta = {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
},
|
},
|
||||||
mandatoryCW: {
|
|
||||||
type: 'string',
|
|
||||||
optional: false, nullable: true,
|
|
||||||
},
|
|
||||||
signins: {
|
signins: {
|
||||||
type: 'array',
|
type: 'array',
|
||||||
optional: false, nullable: false,
|
optional: false, nullable: false,
|
||||||
|
@ -264,7 +260,6 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
||||||
isHibernated: user.isHibernated,
|
isHibernated: user.isHibernated,
|
||||||
lastActiveDate: user.lastActiveDate ? user.lastActiveDate.toISOString() : null,
|
lastActiveDate: user.lastActiveDate ? user.lastActiveDate.toISOString() : null,
|
||||||
moderationNote: profile.moderationNote ?? '',
|
moderationNote: profile.moderationNote ?? '',
|
||||||
mandatoryCW: user.mandatoryCW,
|
|
||||||
signins,
|
signins,
|
||||||
policies: await this.roleService.getUserPolicies(user.id),
|
policies: await this.roleService.getUserPolicies(user.id),
|
||||||
roles: await this.roleEntityService.packMany(roles, me),
|
roles: await this.roleEntityService.packMany(roles, me),
|
||||||
|
|
|
@ -288,7 +288,7 @@ function createFetcher() {
|
||||||
markedAsNSFW.value = info.value.alwaysMarkNsfw;
|
markedAsNSFW.value = info.value.alwaysMarkNsfw;
|
||||||
suspended.value = info.value.isSuspended;
|
suspended.value = info.value.isSuspended;
|
||||||
moderationNote.value = info.value.moderationNote;
|
moderationNote.value = info.value.moderationNote;
|
||||||
mandatoryCW.value = info.value.mandatoryCW;
|
mandatoryCW.value = user.value.mandatoryCW;
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -3968,6 +3968,7 @@ export type components = {
|
||||||
isSystem?: boolean;
|
isSystem?: boolean;
|
||||||
noindex: boolean;
|
noindex: boolean;
|
||||||
enableRss: boolean;
|
enableRss: boolean;
|
||||||
|
mandatoryCW: string | null;
|
||||||
isBot?: boolean;
|
isBot?: boolean;
|
||||||
isCat?: boolean;
|
isCat?: boolean;
|
||||||
speakAsCat?: boolean;
|
speakAsCat?: boolean;
|
||||||
|
|
Loading…
Add table
Reference in a new issue