mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-14 20:19:26 +01:00
Lint project
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Announce from 'App/Models/Announce'
|
||||
import AnnounceUpdateValidator from 'App/Validators/announce/AnnounceUpdateValidator'
|
||||
import File from 'App/Models/File'
|
||||
@@ -25,7 +25,8 @@ export default class AnnouncesController {
|
||||
await announce.related('message').associate(await getTranslation(data.code))
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await announce.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await announce.related('cover').associate(cover)
|
||||
|
||||
await announce.merge(data).save()
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import AuthValidator from 'App/Validators/AuthValidator'
|
||||
|
||||
export default class AuthController {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Experience from 'App/Models/Experience'
|
||||
import ExperienceStoreValidator from 'App/Validators/experience/ExperienceStoreValidator'
|
||||
import ExperienceUpdateValidator from 'App/Validators/experience/ExperienceUpdateValidator'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Application from '@ioc:Adonis/Core/Application'
|
||||
import File from 'App/Models/File'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import FormationStoreValidator from 'App/Validators/formation/FormationStoreValidator'
|
||||
import FormationUpdateValidator from 'App/Validators/formation/FormationUpdateValidator'
|
||||
import Formation from 'App/Models/Formation'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import FormStoreValidator from 'App/Validators/form/FormStoreValidator'
|
||||
import Form from 'App/Models/Form'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { 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'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Location from 'App/Models/Location'
|
||||
import LocationValidator from 'App/Validators/location/LocationValidator'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Maintenance from 'App/Models/Maintenance'
|
||||
import MaintenanceUpdateValidator from 'App/Validators/maintenance/MaintenanceUpdateValidator'
|
||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import PostColor from 'App/Models/PostColor'
|
||||
import PostColorStoreValidator from 'App/Validators/postColor/PostColorStoreValidator'
|
||||
import PostColorUpdateValidator from 'App/Validators/postColor/PostColorUpdateValidator'
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import Post from 'App/Models/Post'
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import PostUpdateValidator from 'App/Validators/post/PostUpdateValidator'
|
||||
import File from 'App/Models/File'
|
||||
import PostStoreValidator from 'App/Validators/post/PostStoreValidator'
|
||||
@@ -90,10 +90,12 @@ export default class PostsController {
|
||||
await post.related('content').associate(await getTranslation(data.content!))
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await post.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await post.related('cover').associate(cover)
|
||||
|
||||
const color = await PostColor.findBy('name', data.color)
|
||||
if (color) await post.related('color').associate(color)
|
||||
if (color)
|
||||
await post.related('color').associate(color)
|
||||
|
||||
return response.status(200).send({
|
||||
post,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
|
||||
export default class ProfileController {
|
||||
public me({ response }: HttpContextContract) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Project from 'App/Models/Project'
|
||||
import ProjectStoreValidator from 'App/Validators/project/ProjectStoreValidator'
|
||||
import ProjectUpdateValidator from 'App/Validators/project/ProjectUpdateValidator'
|
||||
@@ -49,9 +49,11 @@ export default class ProjectsController {
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
|
||||
await project.merge(data).save()
|
||||
if (cover) await project.related('cover').associate(cover)
|
||||
if (cover)
|
||||
await project.related('cover').associate(cover)
|
||||
|
||||
if (data.description) await project.related('description').associate(await getTranslation(data.description))
|
||||
if (data.description)
|
||||
await project.related('description').associate(await getTranslation(data.description))
|
||||
|
||||
await project.related('tags').sync(data.tags!)
|
||||
return response.status(200).send({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import File from 'App/Models/File'
|
||||
import Skill from 'App/Models/Skill'
|
||||
import SkillStoreValidator from 'App/Validators/skill/SkillStoreValidator'
|
||||
@@ -19,7 +19,8 @@ export default class SkillsController {
|
||||
const skill = await Skill.create(data)
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await skill.related('file').associate(cover)
|
||||
if (cover)
|
||||
await skill.related('file').associate(cover)
|
||||
|
||||
return response.status(200).send({
|
||||
skill,
|
||||
@@ -39,7 +40,8 @@ export default class SkillsController {
|
||||
const skill = await Skill.findOrFail(params.id)
|
||||
|
||||
const cover = await File.findBy('label', data.cover)
|
||||
if (cover) await skill.related('file').associate(cover)
|
||||
if (cover)
|
||||
await skill.related('file').associate(cover)
|
||||
await skill.merge(data).save()
|
||||
|
||||
return response.status(200).send({
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import {
|
||||
fetchTopArtist, fetchTopTracks,
|
||||
getAuthorizationURI,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Redis from '@ioc:Adonis/Addons/Redis'
|
||||
import StateSleepingValidator from 'App/Validators/states/StateSleepingValidator'
|
||||
import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils'
|
||||
|
||||
@@ -1,12 +1,12 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import CommandsRun from 'App/Models/CommandsRun'
|
||||
import BuildsRun from 'App/Models/BuildsRun'
|
||||
import {
|
||||
NOW,
|
||||
fetchDailyStatistics,
|
||||
fetchMonthlyStatistics,
|
||||
fetchStatistics,
|
||||
fetchWeeklyStatistics,
|
||||
NOW,
|
||||
} from 'App/Utils/StatsUtils'
|
||||
|
||||
export default class StatsController {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Subscriber from 'App/Models/Subscriber'
|
||||
import SubscriberStoreValidator from 'App/Validators/subscriber/SubscriberStoreValidator'
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import TagStoreValidator from 'App/Validators/tag/TagStoreValidator'
|
||||
import TagUpdateValidator from 'App/Validators/tag/TagUpdateValidator'
|
||||
import Tag from 'App/Models/Tag'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import Translation from 'App/Models/Translation'
|
||||
import TranslationStoreValidator from 'App/Validators/translation/TranslationStoreValidator'
|
||||
import TranslationUpdateValidator from 'App/Validators/translation/TranslationUpdateValidator'
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||
import User from 'App/Models/User'
|
||||
import UserStoreValidator from 'App/Validators/user/UserStoreValidator'
|
||||
import UserUpdateValidator from 'App/Validators/user/UserUpdateValidator'
|
||||
|
||||
Reference in New Issue
Block a user