mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-19 06:21:35 +01:00
Rename Guestbook
This commit is contained in:
@@ -1,16 +1,16 @@
|
||||
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
import GoldenMessage from "../../Models/GoldenMessage";
|
||||
import StoreValidator from "../../Validators/goldenmessages/StoreValidator";
|
||||
import GuestBookMessage from "../../Models/GuestBookMessage";
|
||||
import StoreValidator from "../../Validators/guestbook/StoreValidator";
|
||||
|
||||
export default class GuestBookController {
|
||||
|
||||
public async index () {
|
||||
return GoldenMessage.query().orderBy('created_at', 'desc')
|
||||
return GuestBookMessage.query().orderBy('created_at', 'desc')
|
||||
}
|
||||
|
||||
public async store ({request}: HttpContextContract) {
|
||||
const data = await request.validate(StoreValidator)
|
||||
return await GoldenMessage.create(data)
|
||||
return await GuestBookMessage.create(data)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user