From 384e8c49b738f576ba8843296de6cebf01c1b247 Mon Sep 17 00:00:00 2001 From: Johann150 Date: Tue, 25 Oct 2022 17:12:07 +0200 Subject: [PATCH] server: allow to like own gallery posts 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 4c5aa9e53887cca5561fcec6ab0754e018f589a5. Changelog: Changed --- .../src/server/api/endpoints/gallery/posts/like.ts | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts index d58427a64..60ae30710 100644 --- a/packages/backend/src/server/api/endpoints/gallery/posts/like.ts +++ b/packages/backend/src/server/api/endpoints/gallery/posts/like.ts @@ -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,