server: allow to like own gallery posts
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
All checks were successful
ci/woodpecker/push/lint-client Pipeline was successful
ci/woodpecker/push/lint-foundkey-js Pipeline was successful
ci/woodpecker/push/lint-backend Pipeline was successful
ci/woodpecker/push/build Pipeline was successful
ci/woodpecker/push/test Pipeline was successful
Since you are also allowed to react to your own notes, it seems sensible
that you should be allowed to like your own gallery posts.
Analogous to commit 4c5aa9e538
.
Changelog: Changed
This commit is contained in:
parent
c5e1c42d0a
commit
384e8c49b7
1 changed files with 0 additions and 10 deletions
|
@ -17,12 +17,6 @@ export const meta = {
|
|||
id: '56c06af3-1287-442f-9701-c93f7c4a62ff',
|
||||
},
|
||||
|
||||
yourPost: {
|
||||
message: 'You cannot like your post.',
|
||||
code: 'YOUR_POST',
|
||||
id: 'f78f1511-5ebc-4478-a888-1198d752da68',
|
||||
},
|
||||
|
||||
alreadyLiked: {
|
||||
message: 'The post has already been liked.',
|
||||
code: 'ALREADY_LIKED',
|
||||
|
@ -46,10 +40,6 @@ export default define(meta, paramDef, async (ps, user) => {
|
|||
throw new ApiError(meta.errors.noSuchPost);
|
||||
}
|
||||
|
||||
if (post.userId === user.id) {
|
||||
throw new ApiError(meta.errors.yourPost);
|
||||
}
|
||||
|
||||
// if already liked
|
||||
const exist = await GalleryLikes.findOneBy({
|
||||
postId: post.id,
|
||||
|
|
Loading…
Reference in a new issue