diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2020-11-15 17:32:29 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2020-11-15 17:32:29 +0900 |
| commit | 17cc996288ea3dc7643904238e32a95b51058ec0 (patch) | |
| tree | 206d26c7f84a97f255382be2d806a8065300112c /src/server/api/endpoints/clips/show.ts | |
| parent | Update config.yml (diff) | |
| download | misskey-17cc996288ea3dc7643904238e32a95b51058ec0.tar.gz misskey-17cc996288ea3dc7643904238e32a95b51058ec0.tar.bz2 misskey-17cc996288ea3dc7643904238e32a95b51058ec0.zip | |
他人のpublicなクリップを取得できない問題を修正
Diffstat (limited to 'src/server/api/endpoints/clips/show.ts')
| -rw-r--r-- | src/server/api/endpoints/clips/show.ts | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/api/endpoints/clips/show.ts b/src/server/api/endpoints/clips/show.ts index 5b2b7b7d5e..1d4947528a 100644 --- a/src/server/api/endpoints/clips/show.ts +++ b/src/server/api/endpoints/clips/show.ts @@ -30,12 +30,15 @@ export default define(meta, async (ps, me) => { // Fetch the clip const clip = await Clips.findOne({ id: ps.clipId, - userId: me.id, }); if (clip == null) { throw new ApiError(meta.errors.noSuchClip); } + if (!clip.isPublic && (clip.userId !== me.id)) { + throw new ApiError(meta.errors.noSuchClip); + } + return await Clips.pack(clip); }); |