server: allow to like own pages
Since you are also allowed to react to your own notes, it seems sensible that you should be allowed to like your own pages. Changelog: Changed
This commit is contained in:
parent
2daa02c642
commit
958196a103
|
@ -17,12 +17,6 @@ export const meta = {
|
||||||
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3',
|
id: 'cc98a8a2-0dc3-4123-b198-62c71df18ed3',
|
||||||
},
|
},
|
||||||
|
|
||||||
yourPage: {
|
|
||||||
message: 'You cannot like your page.',
|
|
||||||
code: 'YOUR_PAGE',
|
|
||||||
id: '28800466-e6db-40f2-8fae-bf9e82aa92b8',
|
|
||||||
},
|
|
||||||
|
|
||||||
alreadyLiked: {
|
alreadyLiked: {
|
||||||
message: 'The page has already been liked.',
|
message: 'The page has already been liked.',
|
||||||
code: 'ALREADY_LIKED',
|
code: 'ALREADY_LIKED',
|
||||||
|
@ -46,10 +40,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
||||||
throw new ApiError(meta.errors.noSuchPage);
|
throw new ApiError(meta.errors.noSuchPage);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (page.userId === user.id) {
|
|
||||||
throw new ApiError(meta.errors.yourPage);
|
|
||||||
}
|
|
||||||
|
|
||||||
// if already liked
|
// if already liked
|
||||||
const exist = await PageLikes.findOneBy({
|
const exist = await PageLikes.findOneBy({
|
||||||
pageId: page.id,
|
pageId: page.id,
|
||||||
|
|
Loading…
Reference in New Issue