mirror of
https://iceshrimp.dev/iceshrimp/iceshrimp
synced 2024-12-01 00:08:10 +09:00
他人のpublicなクリップを取得できない問題を修正
This commit is contained in:
parent
61f29c7e48
commit
f2462bb010
@ -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 });
|
||||
|
@ -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);
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user