summaryrefslogtreecommitdiff
path: root/src/server/api/endpoints/clips/notes.ts
diff options
context:
space:
mode:
authorsyuilo <syuilotan@yahoo.co.jp>2020-11-15 17:32:29 +0900
committersyuilo <syuilotan@yahoo.co.jp>2020-11-15 17:32:29 +0900
commit17cc996288ea3dc7643904238e32a95b51058ec0 (patch)
tree206d26c7f84a97f255382be2d806a8065300112c /src/server/api/endpoints/clips/notes.ts
parentUpdate config.yml (diff)
downloadsharkey-17cc996288ea3dc7643904238e32a95b51058ec0.tar.gz
sharkey-17cc996288ea3dc7643904238e32a95b51058ec0.tar.bz2
sharkey-17cc996288ea3dc7643904238e32a95b51058ec0.zip
他人のpublicなクリップを取得できない問題を修正
Diffstat (limited to 'src/server/api/endpoints/clips/notes.ts')
-rw-r--r--src/server/api/endpoints/clips/notes.ts5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/server/api/endpoints/clips/notes.ts b/src/server/api/endpoints/clips/notes.ts
index 5289533a1e..3d66623d63 100644
--- a/src/server/api/endpoints/clips/notes.ts
+++ b/src/server/api/endpoints/clips/notes.ts
@@ -45,13 +45,16 @@ export const meta = {
export default define(meta, async (ps, user) => {
const clip = await Clips.findOne({
id: ps.clipId,
- userId: user.id
});
if (clip == null) {
throw new ApiError(meta.errors.noSuchClip);
}
+ if (!clip.isPublic && (clip.userId !== user.id)) {
+ throw new ApiError(meta.errors.noSuchClip);
+ }
+
const clipQuery = ClipNotes.createQueryBuilder('joining')
.select('joining.noteId')
.where('joining.clipId = :clipId', { clipId: clip.id });