mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-29 19:10:28 +01:00
Rename Guestbook
This commit is contained in:
@@ -1,16 +1,16 @@
|
|||||||
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||||
import GoldenMessage from "../../Models/GoldenMessage";
|
import GuestBookMessage from "../../Models/GuestBookMessage";
|
||||||
import StoreValidator from "../../Validators/goldenmessages/StoreValidator";
|
import StoreValidator from "../../Validators/guestbook/StoreValidator";
|
||||||
|
|
||||||
export default class GuestBookController {
|
export default class GuestBookController {
|
||||||
|
|
||||||
public async index () {
|
public async index () {
|
||||||
return GoldenMessage.query().orderBy('created_at', 'desc')
|
return GuestBookMessage.query().orderBy('created_at', 'desc')
|
||||||
}
|
}
|
||||||
|
|
||||||
public async store ({request}: HttpContextContract) {
|
public async store ({request}: HttpContextContract) {
|
||||||
const data = await request.validate(StoreValidator)
|
const data = await request.validate(StoreValidator)
|
||||||
return await GoldenMessage.create(data)
|
return await GuestBookMessage.create(data)
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import {BaseModel, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
|||||||
import User from "./User";
|
import User from "./User";
|
||||||
import {BelongsTo} from "@ioc:Adonis/Lucid/Relations";
|
import {BelongsTo} from "@ioc:Adonis/Lucid/Relations";
|
||||||
|
|
||||||
export default class GoldenMessage extends BaseModel {
|
export default class GuestBookMessage extends BaseModel {
|
||||||
@column({ isPrimary: true })
|
@column({ isPrimary: true })
|
||||||
public id: number
|
public id: number
|
||||||
|
|
||||||
Reference in New Issue
Block a user