fix: check visibility when serving Like activity
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
This commit is contained in:
parent
375323bc25
commit
2ed46aaebb
1 changed files with 7 additions and 4 deletions
|
@ -206,16 +206,19 @@ router.get('/emojis/:emoji', async ctx => {
|
||||||
|
|
||||||
// like
|
// like
|
||||||
router.get('/likes/:like', async ctx => {
|
router.get('/likes/:like', async ctx => {
|
||||||
const reaction = await NoteReactions.findOneBy({ id: ctx.params.like });
|
const note = await Notes.findOneBy({
|
||||||
|
id: reaction.noteId,
|
||||||
|
visibility: In(['public' as const, 'home' as const]),
|
||||||
|
});
|
||||||
|
|
||||||
if (reaction == null) {
|
if (note == null) {
|
||||||
ctx.status = 404;
|
ctx.status = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
const note = await Notes.findOneBy({ id: reaction.noteId });
|
const reaction = await NoteReactions.findOneBy({ id: ctx.params.like });
|
||||||
|
|
||||||
if (note == null) {
|
if (reaction == null) {
|
||||||
ctx.status = 404;
|
ctx.status = 404;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue