From 61f3854c52c0582d97ce711929594b9d57b1f45c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=BE=E3=81=A3=E3=81=A1=E3=82=83=E3=81=A8=E3=83=BC?= =?UTF-8?q?=E3=81=AB=E3=82=85?= <17376330+u1-liquid@users.noreply.github.com> Date: Fri, 1 Dec 2023 20:46:24 +0900 Subject: [PATCH] =?UTF-8?q?fix(backend):=20Play=E4=BD=9C=E6=88=90=E6=99=82?= =?UTF-8?q?Visibility=E3=81=AE=E8=A8=AD=E5=AE=9A=E3=81=8C=E5=8A=B9?= =?UTF-8?q?=E3=81=8B=E3=81=AA=E3=81=84=E5=95=8F=E9=A1=8C=E3=82=92=E4=BF=AE?= =?UTF-8?q?=E6=AD=A3=20(MisskeyIO#270)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/backend/src/server/api/endpoints/flash/create.ts | 2 ++ packages/backend/src/server/api/endpoints/flash/featured.ts | 1 + packages/frontend/src/pages/flash/flash-edit.vue | 1 + 3 files changed, 4 insertions(+) diff --git a/packages/backend/src/server/api/endpoints/flash/create.ts b/packages/backend/src/server/api/endpoints/flash/create.ts index 64c3a107e3..e9f554039e 100644 --- a/packages/backend/src/server/api/endpoints/flash/create.ts +++ b/packages/backend/src/server/api/endpoints/flash/create.ts @@ -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 { // 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); diff --git a/packages/backend/src/server/api/endpoints/flash/featured.ts b/packages/backend/src/server/api/endpoints/flash/featured.ts index 1fa5612ac4..40967fee2e 100644 --- a/packages/backend/src/server/api/endpoints/flash/featured.ts +++ b/packages/backend/src/server/api/endpoints/flash/featured.ts @@ -42,6 +42,7 @@ export default class extends Endpoint { // 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(); diff --git a/packages/frontend/src/pages/flash/flash-edit.vue b/packages/frontend/src/pages/flash/flash-edit.vue index f494218c18..455332541a 100644 --- a/packages/frontend/src/pages/flash/flash-edit.vue +++ b/packages/frontend/src/pages/flash/flash-edit.vue @@ -417,6 +417,7 @@ async function save() { summary, permissions, script, + visibility, }); router.push('/play/' + created.id + '/edit'); }