mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-18 05:57:58 +01:00
Lint and update
This commit is contained in:
@@ -1,20 +1,19 @@
|
||||
import {HttpContextContract} from "@ioc:Adonis/Core/HttpContext";
|
||||
import Information from "App/Models/Information";
|
||||
import InformationUpdateValidator from "App/Validators/information/InformationUpdateValidator";
|
||||
import {getTranslation} from "App/Utils/TranslationsUtils";
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Information from 'App/Models/Information'
|
||||
import InformationUpdateValidator from 'App/Validators/information/InformationUpdateValidator'
|
||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
||||
|
||||
export default class InformationsController {
|
||||
|
||||
public async index ({ response }: HttpContextContract) {
|
||||
public async index({ response }: HttpContextContract) {
|
||||
return response.status(200).send({
|
||||
informations: await Information
|
||||
.query()
|
||||
.preload('translation')
|
||||
.first()
|
||||
.first(),
|
||||
})
|
||||
}
|
||||
|
||||
public async update ({ response, request }: HttpContextContract) {
|
||||
public async update({ response, request }: HttpContextContract) {
|
||||
const information = await Information.firstOrFail()
|
||||
const data = await request.validate(InformationUpdateValidator)
|
||||
|
||||
@@ -26,8 +25,7 @@ export default class InformationsController {
|
||||
await information.merge(data).save()
|
||||
|
||||
return response.status(200).send({
|
||||
information
|
||||
information,
|
||||
})
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user