1
0
mirror of https://github.com/MisskeyIO/misskey synced 2024-11-27 22:38:30 +09:00

他人のpublicなクリップを取得できない問題を修正

This commit is contained in:
syuilo 2020-11-15 17:32:29 +09:00
parent 385776dc0f
commit 17cc996288
2 changed files with 8 additions and 2 deletions

View File

@ -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 });

View File

@ -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);
});