mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-22 07:50:27 +01:00
Working on new version of website
Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
@@ -3,7 +3,7 @@ import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
|
||||
export default class PostsController {
|
||||
|
||||
public async getLikes({params, response}: HttpContextContract) {
|
||||
public async getLikes ({ params, response }: HttpContextContract) {
|
||||
let post = await Post.findBy('slug', params.slug)
|
||||
|
||||
if (!post) {
|
||||
@@ -18,7 +18,7 @@ export default class PostsController {
|
||||
})
|
||||
}
|
||||
|
||||
public async like ({params, response}: HttpContextContract) {
|
||||
public async like ({ params, response }: HttpContextContract) {
|
||||
let post = await Post.findBy('slug', params.slug)
|
||||
|
||||
if (!post) {
|
||||
@@ -38,7 +38,7 @@ export default class PostsController {
|
||||
})
|
||||
}
|
||||
|
||||
public async unlike ({params, response}: HttpContextContract) {
|
||||
public async unlike ({ params, response }: HttpContextContract) {
|
||||
let post = await Post.findByOrFail('slug', params.slug)
|
||||
|
||||
const getLikes = post.likes - 1
|
||||
|
||||
Reference in New Issue
Block a user