mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-23 00:10:27 +01:00
Add OAuth
This commit is contained in:
20
app/Controllers/Http/GoldenMessagesController.ts
Normal file
20
app/Controllers/Http/GoldenMessagesController.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
import GoldenMessage from "../../Models/GoldenMessage";
|
||||
import StoreValidator from "../../Validators/goldenmessages/StoreValidator";
|
||||
|
||||
export default class GoldenMessagesController {
|
||||
|
||||
public async index () {
|
||||
return GoldenMessage.query().orderBy('created_at', 'desc')
|
||||
}
|
||||
|
||||
public async store ({request}: HttpContextContract) {
|
||||
const data = await request.validate(StoreValidator)
|
||||
return await GoldenMessage.create(data)
|
||||
}
|
||||
|
||||
public async show ({params}: HttpContextContract) {
|
||||
return await GoldenMessage.findOrFail(params.id)
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user