mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-19 22:41:35 +01:00
Add GuestBook routes
This commit is contained in:
@@ -2,7 +2,7 @@ import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
import GoldenMessage from "../../Models/GoldenMessage";
|
||||
import StoreValidator from "../../Validators/goldenmessages/StoreValidator";
|
||||
|
||||
export default class GoldenMessagesController {
|
||||
export default class GuestBookController {
|
||||
|
||||
public async index () {
|
||||
return GoldenMessage.query().orderBy('created_at', 'desc')
|
||||
@@ -13,8 +13,4 @@ export default class GoldenMessagesController {
|
||||
return await GoldenMessage.create(data)
|
||||
}
|
||||
|
||||
public async show ({params}: HttpContextContract) {
|
||||
return await GoldenMessage.findOrFail(params.id)
|
||||
}
|
||||
|
||||
}
|
||||
@@ -53,11 +53,14 @@ Route.group(() => {
|
||||
Route.resource('files', 'FileController').only(['store', 'destroy'])
|
||||
Route.post('/locations', 'LocationsController.add')
|
||||
Route.post('/projects', 'ProjectsController.add')
|
||||
|
||||
Route.resource('guestbook', 'GuestBookController').only(['index', 'show'])
|
||||
}).middleware('auth:web')
|
||||
|
||||
Route.group(() => {
|
||||
// ArtAPI
|
||||
Route.post('form', 'FormsController.send')
|
||||
Route.post('form', 'FormsController.send')
|
||||
// ArtSite
|
||||
Route.group(() => {
|
||||
Route.get('/:slug', 'PostsController.getLikes')
|
||||
|
||||
Reference in New Issue
Block a user