fix(backend): Play作成時Visibilityの設定が効かない問題を修正 (MisskeyIO#270)
This commit is contained in:
parent
41cd11bbf7
commit
61f3854c52
|
@ -39,6 +39,7 @@ export const paramDef = {
|
|||
permissions: { type: 'array', items: {
|
||||
type: 'string',
|
||||
} },
|
||||
visibility: { type: 'string', enum: ['public', 'private'] },
|
||||
},
|
||||
required: ['title', 'summary', 'script', 'permissions'],
|
||||
} as const;
|
||||
|
@ -61,6 +62,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
summary: ps.summary,
|
||||
script: ps.script,
|
||||
permissions: ps.permissions,
|
||||
visibility: ps.visibility,
|
||||
}).then(x => this.flashsRepository.findOneByOrFail(x.identifiers[0]));
|
||||
|
||||
return await this.flashEntityService.pack(flash, me);
|
||||
|
|
|
@ -42,6 +42,7 @@ export default class extends Endpoint<typeof meta, typeof paramDef> { // eslint-
|
|||
super(meta, paramDef, async (ps, me) => {
|
||||
const query = this.flashsRepository.createQueryBuilder('flash')
|
||||
.andWhere('flash.likedCount > 0')
|
||||
.andWhere('flash.visibility = \'public\'')
|
||||
.orderBy('flash.likedCount', 'DESC');
|
||||
|
||||
const flashs = await query.limit(10).getMany();
|
||||
|
|
|
@ -417,6 +417,7 @@ async function save() {
|
|||
summary,
|
||||
permissions,
|
||||
script,
|
||||
visibility,
|
||||
});
|
||||
router.push('/play/' + created.id + '/edit');
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue