diff --git a/app/Controllers/Http/PostsController.ts b/app/Controllers/Http/PostsController.ts index 2f65f25..66ce3fa 100644 --- a/app/Controllers/Http/PostsController.ts +++ b/app/Controllers/Http/PostsController.ts @@ -26,7 +26,7 @@ export default class PostsController { }) } - const getLikes = post.likes++ + const getLikes = post.likes + 1 await post.merge({ likes: getLikes @@ -40,7 +40,7 @@ export default class PostsController { public async unlike ({params, response}: HttpContextContract) { let post = await Post.findByOrFail('slug', params.slug) - const getLikes = post.likes-- + const getLikes = post.likes - 1 await post.merge({ likes: getLikes