fix(backend): make isExplorable optional for backward compatibility

https://github.com/misskey-dev/misskey/pull/10677#issuecomment-1516394630
This commit is contained in:
tamaina 2023-04-20 16:09:54 +00:00
parent 8dc60cd327
commit 5cae078e5e

View file

@ -25,7 +25,7 @@ export const paramDef = {
isPublic: { type: 'boolean' }, isPublic: { type: 'boolean' },
isModerator: { type: 'boolean' }, isModerator: { type: 'boolean' },
isAdministrator: { type: 'boolean' }, isAdministrator: { type: 'boolean' },
isExplorable: { type: 'boolean' }, isExplorable: { type: 'boolean', default: false }, // optional for backward compatibility
asBadge: { type: 'boolean' }, asBadge: { type: 'boolean' },
canEditMembersByModerator: { type: 'boolean' }, canEditMembersByModerator: { type: 'boolean' },
displayOrder: { type: 'number' }, displayOrder: { type: 'number' },
@ -43,7 +43,6 @@ export const paramDef = {
'isPublic', 'isPublic',
'isModerator', 'isModerator',
'isAdministrator', 'isAdministrator',
'isExplorable',
'asBadge', 'asBadge',
'canEditMembersByModerator', 'canEditMembersByModerator',
'displayOrder', 'displayOrder',
@ -84,7 +83,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> {
displayOrder: ps.displayOrder, displayOrder: ps.displayOrder,
policies: ps.policies, policies: ps.policies,
}).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0])); }).then(x => this.rolesRepository.findOneByOrFail(x.identifiers[0]));
this.globalEventService.publishInternalEvent('roleCreated', created); this.globalEventService.publishInternalEvent('roleCreated', created);
return await this.roleEntityService.pack(created, me); return await this.roleEntityService.pack(created, me);