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

@@ -4,13 +4,13 @@ import File from "App/Models/File";
export default class FileController {
public async index({response}: HttpContextContract) {
public async index ({ response }: HttpContextContract) {
return response.status(200).send({
files: File.query()
})
}
public async store({request, response}: HttpContextContract) {
public async store ({ request, response }: HttpContextContract) {
const file = await request.file('file', {
extnames: ['jpg', 'png', 'jpeg']
})
@@ -35,7 +35,7 @@ export default class FileController {
})
}
public async destroy({params, response}: HttpContextContract) {
public async destroy ({ params, response }: HttpContextContract) {
const file = await File.findOrFail(params.id)
await file.delete()
return response.status(200).send({