Working on new version of website

Signed-off-by: Arthur DANJOU <arthurdanjou@outlook.fr>
This commit is contained in:
2021-08-05 15:26:36 +02:00
parent ed17d86913
commit 721eb3addc
43 changed files with 525 additions and 320 deletions

View File

@@ -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