mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-29 19:10:28 +01:00
Removing website data and add sport state
This commit is contained in:
@@ -1,37 +0,0 @@
|
|||||||
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'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class AnnouncesController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const announce = await Announce
|
|
||||||
.query()
|
|
||||||
.orderBy('created_at', 'desc')
|
|
||||||
.preload('message')
|
|
||||||
.preload('cover')
|
|
||||||
.first()
|
|
||||||
return response.status(200).send({
|
|
||||||
announce,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(AnnounceUpdateValidator)
|
|
||||||
const announce = await Announce.findOrFail(params.id)
|
|
||||||
|
|
||||||
if (data.code)
|
|
||||||
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)
|
|
||||||
|
|
||||||
await announce.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
announce,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,57 +0,0 @@
|
|||||||
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'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class ExperiencesController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const experiences = await Experience
|
|
||||||
.query()
|
|
||||||
.orderBy('begin_date', 'desc')
|
|
||||||
.preload('title')
|
|
||||||
return response.status(200).send({
|
|
||||||
experiences,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(ExperienceStoreValidator)
|
|
||||||
const experience = await Experience.create(data)
|
|
||||||
await experience.related('title').associate(await getTranslation(data.title))
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
experience,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const experience = await Experience.findOrFail(params.id)
|
|
||||||
experience.load('title')
|
|
||||||
return response.status(200).send({
|
|
||||||
experience,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(ExperienceUpdateValidator)
|
|
||||||
const experience = await Experience.findOrFail(params.id)
|
|
||||||
|
|
||||||
if (data.title)
|
|
||||||
await experience.related('title').associate(await getTranslation(data.title))
|
|
||||||
|
|
||||||
await experience.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
experience,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const experience = await Experience.findOrFail(params.id)
|
|
||||||
await experience.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Experience successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,64 +0,0 @@
|
|||||||
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'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class FormationsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const formations = await Formation
|
|
||||||
.query()
|
|
||||||
.orderBy('begin_date', 'desc')
|
|
||||||
.preload('title')
|
|
||||||
.preload('description')
|
|
||||||
return response.status(200).send({
|
|
||||||
formations,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(FormationStoreValidator)
|
|
||||||
const formation = await Formation.create(data)
|
|
||||||
|
|
||||||
await formation.related('title').associate(await getTranslation(data.title))
|
|
||||||
await formation.related('description').associate(await getTranslation(data.description))
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
formation,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const formation = await Formation.findOrFail(params.id)
|
|
||||||
formation.load('title')
|
|
||||||
formation.load('description')
|
|
||||||
return response.status(200).send({
|
|
||||||
formation,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(FormationUpdateValidator)
|
|
||||||
const formation = await Formation.findOrFail(params.id)
|
|
||||||
|
|
||||||
if (data.title)
|
|
||||||
await formation.related('title').associate(await getTranslation(data.title))
|
|
||||||
|
|
||||||
if (data.description)
|
|
||||||
await formation.related('description').associate(await getTranslation(data.description))
|
|
||||||
|
|
||||||
await formation.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
formation,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const formation = await Formation.findOrFail(params.id)
|
|
||||||
await formation.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Formation successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,33 +0,0 @@
|
|||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
import FormStoreValidator from 'App/Validators/form/FormStoreValidator'
|
|
||||||
import Form from 'App/Models/Form'
|
|
||||||
|
|
||||||
export default class FormsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
forms: Form.query().orderBy('created_at', 'asc'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(FormStoreValidator)
|
|
||||||
// todo send confirmation email + email to me with FormConfirmation
|
|
||||||
return response.status(200).send({
|
|
||||||
form: await Form.create(data),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
form: await Form.findOrFail(params.id),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const form = await Form.findOrFail(params.id)
|
|
||||||
await form.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Form successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
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'
|
|
||||||
|
|
||||||
export default class InformationsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
informations: await Information
|
|
||||||
.query()
|
|
||||||
.preload('translation')
|
|
||||||
.first(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ response, request }: HttpContextContract) {
|
|
||||||
const information = await Information.firstOrFail()
|
|
||||||
const data = await request.validate(InformationUpdateValidator)
|
|
||||||
|
|
||||||
if (data.code) {
|
|
||||||
const translation = await getTranslation(data.code)
|
|
||||||
await information.related('translation').associate(translation)
|
|
||||||
}
|
|
||||||
|
|
||||||
await information.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
information,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
import Location from 'App/Models/Location'
|
|
||||||
import LocationValidator from 'App/Validators/location/LocationValidator'
|
|
||||||
|
|
||||||
export default class LocationsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const location = await Location.query().orderBy('since', 'desc').first()
|
|
||||||
if (location) {
|
|
||||||
return response.status(200).send({
|
|
||||||
location: {
|
|
||||||
place: location.place,
|
|
||||||
left: location.left,
|
|
||||||
since: location.since,
|
|
||||||
},
|
|
||||||
})
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
return response.status(200).send({
|
|
||||||
location: 'Location is unknown...',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(LocationValidator)
|
|
||||||
const location = await Location.create(data)
|
|
||||||
return response.status(200).send({
|
|
||||||
location,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
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'
|
|
||||||
|
|
||||||
export default class MaintenancesController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const maintenance = await Maintenance
|
|
||||||
.query()
|
|
||||||
.orderBy('created_at', 'desc')
|
|
||||||
.preload('reason')
|
|
||||||
.first()
|
|
||||||
return response.status(200).send({
|
|
||||||
maintenance,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(MaintenanceUpdateValidator)
|
|
||||||
const maintenance = await Maintenance.findOrFail(params.id)
|
|
||||||
|
|
||||||
if (data.reason)
|
|
||||||
await maintenance.related('reason').associate(await getTranslation(data.reason))
|
|
||||||
|
|
||||||
await maintenance.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
maintenance,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,44 +0,0 @@
|
|||||||
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'
|
|
||||||
|
|
||||||
export default class PostColorsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
post_colors: await PostColor.all(),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(PostColorStoreValidator)
|
|
||||||
const postColor = await PostColor.create(data)
|
|
||||||
return response.status(200).send({
|
|
||||||
post_color: postColor,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const postColor = await PostColor.findOrFail(params.id)
|
|
||||||
return response.status(200).send({
|
|
||||||
post_color: postColor,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(PostColorUpdateValidator)
|
|
||||||
const postColor = await PostColor.findOrFail(params.id)
|
|
||||||
await postColor.merge(data).save()
|
|
||||||
return response.status(200).send({
|
|
||||||
post_color: postColor,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const postColor = await PostColor.findOrFail(params.id)
|
|
||||||
await postColor.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'PostColor successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,139 +0,0 @@
|
|||||||
import Post from 'App/Models/Post'
|
|
||||||
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'
|
|
||||||
import PostColor from 'App/Models/PostColor'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class PostsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
posts: await Post.query()
|
|
||||||
.orderBy('id', 'desc')
|
|
||||||
.preload('tags', (tags) => {
|
|
||||||
tags.preload('label')
|
|
||||||
})
|
|
||||||
.preload('cover')
|
|
||||||
.preload('color')
|
|
||||||
.preload('content')
|
|
||||||
.preload('title')
|
|
||||||
.preload('description'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(PostStoreValidator)
|
|
||||||
const post = await Post.create(data)
|
|
||||||
|
|
||||||
const cover = await File.findByOrFail('label', data.cover)
|
|
||||||
const color = await PostColor.findByOrFail('name', data.color)
|
|
||||||
|
|
||||||
await post.related('cover').associate(cover)
|
|
||||||
await post.related('color').associate(color)
|
|
||||||
|
|
||||||
await post.related('description').associate(await getTranslation(data.description))
|
|
||||||
await post.related('title').associate(await getTranslation(data.title))
|
|
||||||
await post.related('content').associate(await getTranslation(data.content))
|
|
||||||
|
|
||||||
await post.related('tags').sync(data.tags!)
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const post = await Post.findOrFail(params.id)
|
|
||||||
await post.load('cover')
|
|
||||||
await post.load('title')
|
|
||||||
await post.load('description')
|
|
||||||
await post.load('content')
|
|
||||||
await post.load('color')
|
|
||||||
await post.load('tags', (tags) => {
|
|
||||||
tags.preload('label')
|
|
||||||
})
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async get({ params, response }: HttpContextContract) {
|
|
||||||
const post = await Post.firstOrCreate({
|
|
||||||
slug: params.slug,
|
|
||||||
}, {
|
|
||||||
slug: params.slug,
|
|
||||||
likes: 0,
|
|
||||||
})
|
|
||||||
await post.load('tags', (tags) => {
|
|
||||||
tags.preload('label')
|
|
||||||
})
|
|
||||||
await post.load('cover')
|
|
||||||
await post.load('description')
|
|
||||||
await post.load('title')
|
|
||||||
await post.load('content')
|
|
||||||
await post.load('color')
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const post = await Post.findOrFail(params.id)
|
|
||||||
const data = await request.validate(PostUpdateValidator)
|
|
||||||
|
|
||||||
await post.merge(data).save()
|
|
||||||
|
|
||||||
await post.related('tags').sync(data.tags!)
|
|
||||||
await post.related('description').associate(await getTranslation(data.description!))
|
|
||||||
await post.related('title').associate(await getTranslation(data.title!))
|
|
||||||
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)
|
|
||||||
|
|
||||||
const color = await PostColor.findBy('name', data.color)
|
|
||||||
if (color)
|
|
||||||
await post.related('color').associate(color)
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const post = await Post.findOrFail(params.id)
|
|
||||||
await post.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Post successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async like({ params, response }: HttpContextContract) {
|
|
||||||
const post = await Post.firstOrCreate({
|
|
||||||
slug: params.slug,
|
|
||||||
}, {
|
|
||||||
slug: params.slug,
|
|
||||||
likes: 0,
|
|
||||||
})
|
|
||||||
const getLikes = post.likes
|
|
||||||
await post.merge({
|
|
||||||
likes: getLikes + 1,
|
|
||||||
}).save()
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async unlike({ params, response }: HttpContextContract) {
|
|
||||||
const post = await Post.findByOrFail('slug', params.slug)
|
|
||||||
const getLikes = post.likes
|
|
||||||
await post.merge({
|
|
||||||
likes: getLikes - 1,
|
|
||||||
}).save()
|
|
||||||
return response.status(200).send({
|
|
||||||
post,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -37,7 +37,7 @@ export default class ProfileController {
|
|||||||
},
|
},
|
||||||
databases: ['MongoDB', 'MariaDB', 'Redis'],
|
databases: ['MongoDB', 'MariaDB', 'Redis'],
|
||||||
messaging: ['RabbitMQ'],
|
messaging: ['RabbitMQ'],
|
||||||
other: ['Docker', 'Git'],
|
other: ['Docker', 'Git', 'Kubernetes'],
|
||||||
operating_systems: ['MacOS', 'Linux'],
|
operating_systems: ['MacOS', 'Linux'],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
|
|||||||
@@ -1,71 +0,0 @@
|
|||||||
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'
|
|
||||||
import File from 'App/Models/File'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class ProjectsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
projects: await Project.query()
|
|
||||||
.orderBy('id', 'asc')
|
|
||||||
.preload('cover')
|
|
||||||
.preload('description')
|
|
||||||
.preload('tags', (tags) => {
|
|
||||||
tags.preload('label')
|
|
||||||
}),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(ProjectStoreValidator)
|
|
||||||
const project = await Project.create(data)
|
|
||||||
const cover = await File.findByOrFail('label', data.cover)
|
|
||||||
|
|
||||||
await project.related('cover').associate(cover)
|
|
||||||
await project.related('description').associate(await getTranslation(data.description))
|
|
||||||
await project.related('tags').sync(data.tags!)
|
|
||||||
return response.status(200).send({
|
|
||||||
project,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const project = await Project.findOrFail(params.id)
|
|
||||||
await project.load('cover')
|
|
||||||
await project.load('description')
|
|
||||||
await project.load('tags', (tags) => {
|
|
||||||
tags.preload('label')
|
|
||||||
})
|
|
||||||
return response.status(200).send({
|
|
||||||
project,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const project = await Project.findOrFail(params.id)
|
|
||||||
const data = await request.validate(ProjectUpdateValidator)
|
|
||||||
const cover = await File.findBy('label', data.cover)
|
|
||||||
|
|
||||||
await project.merge(data).save()
|
|
||||||
if (cover)
|
|
||||||
await project.related('cover').associate(cover)
|
|
||||||
|
|
||||||
if (data.description)
|
|
||||||
await project.related('description').associate(await getTranslation(data.description))
|
|
||||||
|
|
||||||
await project.related('tags').sync(data.tags!)
|
|
||||||
return response.status(200).send({
|
|
||||||
project,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const project = await Project.findOrFail(params.id)
|
|
||||||
await project.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Project successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,59 +0,0 @@
|
|||||||
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'
|
|
||||||
import SkillUpdateValidator from 'App/Validators/skill/SkillUpdateValidator'
|
|
||||||
|
|
||||||
export default class SkillsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const skills = await Skill
|
|
||||||
.query()
|
|
||||||
.preload('file')
|
|
||||||
return response.status(200).send({
|
|
||||||
skills,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(SkillStoreValidator)
|
|
||||||
const skill = await Skill.create(data)
|
|
||||||
|
|
||||||
const cover = await File.findBy('label', data.cover)
|
|
||||||
if (cover)
|
|
||||||
await skill.related('file').associate(cover)
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
skill,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const skill = await Skill.findOrFail(params.id)
|
|
||||||
skill.load('file')
|
|
||||||
return response.status(200).send({
|
|
||||||
skill,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(SkillUpdateValidator)
|
|
||||||
const skill = await Skill.findOrFail(params.id)
|
|
||||||
|
|
||||||
const cover = await File.findBy('label', data.cover)
|
|
||||||
if (cover)
|
|
||||||
await skill.related('file').associate(cover)
|
|
||||||
await skill.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
skill,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const skill = await Skill.findOrFail(params.id)
|
|
||||||
await skill.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Skill successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,21 +1,23 @@
|
|||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||||
import Redis from '@ioc:Adonis/Addons/Redis'
|
import Redis from '@ioc:Adonis/Addons/Redis'
|
||||||
import StateSleepingValidator from 'App/Validators/states/StateSleepingValidator'
|
import StateValidator from 'App/Validators/states/StateValidator'
|
||||||
import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils'
|
import { getCurrentPlayingFromCache } from 'App/Utils/SongUtils'
|
||||||
|
|
||||||
export default class StatesController {
|
export default class StatesController {
|
||||||
public async index({ response }: HttpContextContract) {
|
public async index({ response }: HttpContextContract) {
|
||||||
const sleeping = this.formatValue(await Redis.get('states:sleeping'))
|
const sleep = this.formatValue(await Redis.get('states:sleeping'))
|
||||||
const developing = this.formatValue(await Redis.get('states:developing'))
|
const develop = this.formatValue(await Redis.get('states:developing'))
|
||||||
|
const sport = this.formatValue(await Redis.get('states:sporting'))
|
||||||
return response.status(200).send({
|
return response.status(200).send({
|
||||||
sleeping,
|
is_sleeping: sleep,
|
||||||
developing,
|
is_developing: develop,
|
||||||
|
is_sporting: sport,
|
||||||
listening_music: await getCurrentPlayingFromCache(),
|
listening_music: await getCurrentPlayingFromCache(),
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
public async setSleeping({ request, response }: HttpContextContract) {
|
public async setSleep({ request, response }: HttpContextContract) {
|
||||||
const { value } = await request.validate(StateSleepingValidator)
|
const { value } = await request.validate(StateValidator)
|
||||||
await Redis.set('states:sleeping', String(value))
|
await Redis.set('states:sleeping', String(value))
|
||||||
await Redis.set('states:developing', String(!value))
|
await Redis.set('states:developing', String(!value))
|
||||||
return response.status(200).send({
|
return response.status(200).send({
|
||||||
@@ -24,6 +26,16 @@ export default class StatesController {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public async setSport({ request, response }: HttpContextContract) {
|
||||||
|
const { value } = await request.validate(StateValidator)
|
||||||
|
await Redis.set('states:sporting', String(value))
|
||||||
|
await Redis.set('states:sleeping', String(!value))
|
||||||
|
return response.status(200).send({
|
||||||
|
message: 'State was successfully set!',
|
||||||
|
value: this.formatValue(String(value)),
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
public formatValue(value: string | null): string {
|
public formatValue(value: string | null): string {
|
||||||
return value === 'true' ? 'Yes' : 'No'
|
return value === 'true' ? 'Yes' : 'No'
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +0,0 @@
|
|||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
import Subscriber from 'App/Models/Subscriber'
|
|
||||||
import SubscriberStoreValidator from 'App/Validators/subscriber/SubscriberStoreValidator'
|
|
||||||
|
|
||||||
export default class SubscribersController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const subscribers = await Subscriber.query()
|
|
||||||
return response.status(200).send({
|
|
||||||
count: subscribers.length,
|
|
||||||
subscribers,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(SubscriberStoreValidator)
|
|
||||||
return response.status(200).send({
|
|
||||||
subscriber: await Subscriber.create(data),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ params, response }: HttpContextContract) {
|
|
||||||
const subscriber = await Subscriber.findOrFail(params.id)
|
|
||||||
await subscriber.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Subscriber successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,55 +0,0 @@
|
|||||||
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'
|
|
||||||
import { getTranslation } from 'App/Utils/TranslationsUtils'
|
|
||||||
|
|
||||||
export default class TagsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
const tags = await Tag
|
|
||||||
.query()
|
|
||||||
.preload('label')
|
|
||||||
return response.status(200).send({
|
|
||||||
tags,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(TagStoreValidator)
|
|
||||||
const tag = await Tag.create({})
|
|
||||||
|
|
||||||
await tag.related('label').associate(await getTranslation(data.label))
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
tag,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
const tag = await Tag.findOrFail(params.id)
|
|
||||||
tag.load('label')
|
|
||||||
return response.status(200).send({
|
|
||||||
tag,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(TagUpdateValidator)
|
|
||||||
const tag = await Tag.findOrFail(params.id)
|
|
||||||
|
|
||||||
if (data.label)
|
|
||||||
await tag.related('label').associate(await getTranslation(data.label))
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
tag,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const tag = await Tag.findOrFail(params.id)
|
|
||||||
await tag.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Tag successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,43 +0,0 @@
|
|||||||
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'
|
|
||||||
|
|
||||||
export default class TranslationsController {
|
|
||||||
public async index({ response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
translations: await Translation.query().orderBy('id', 'asc'),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async store({ request, response }: HttpContextContract) {
|
|
||||||
const data = await request.validate(TranslationStoreValidator)
|
|
||||||
return response.status(200).send({
|
|
||||||
translation: await Translation.create(data),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async show({ params, response }: HttpContextContract) {
|
|
||||||
return response.status(200).send({
|
|
||||||
translation: await Translation.findOrFail(params.id),
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async update({ request, params, response }: HttpContextContract) {
|
|
||||||
const translation = await Translation.findOrFail(params.id)
|
|
||||||
const data = await request.validate(TranslationUpdateValidator)
|
|
||||||
await translation.merge(data).save()
|
|
||||||
|
|
||||||
return response.status(200).send({
|
|
||||||
translation,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
public async destroy({ response, params }: HttpContextContract) {
|
|
||||||
const translation = await Translation.findOrFail(params.id)
|
|
||||||
await translation.delete()
|
|
||||||
return response.status(200).send({
|
|
||||||
message: 'Translation successfully deleted!',
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,38 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import File from 'App/Models/File'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Announce extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public color: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public hoverColor: string
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'messageId',
|
|
||||||
})
|
|
||||||
public message: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public messageId: number
|
|
||||||
|
|
||||||
@belongsTo(() => File, {
|
|
||||||
foreignKey: 'coverId',
|
|
||||||
})
|
|
||||||
public cover: BelongsTo<typeof File>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public coverId: number
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,35 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Experience extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'titleId',
|
|
||||||
})
|
|
||||||
public title: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public titleId: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public company: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public location: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public beginDate: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public endDate: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
|
|
||||||
export default class Form extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public name: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public email: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public subject: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public content: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,40 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Formation extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'titleId',
|
|
||||||
})
|
|
||||||
public title: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public titleId: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'descriptionId',
|
|
||||||
})
|
|
||||||
public description: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public descriptionId: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public location: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public beginDate: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public endDate: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Information extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public age: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation)
|
|
||||||
public translation: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public translationId: number
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,26 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Maintenance extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public active: boolean
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'reasonId',
|
|
||||||
})
|
|
||||||
public reason: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public reasonId: number
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,73 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo, ManyToMany } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column, manyToMany } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Tag from 'App/Models/Tag'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
import File from 'App/Models/File'
|
|
||||||
import PostColor from 'App/Models/PostColor'
|
|
||||||
|
|
||||||
export default class Post extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@manyToMany(() => Tag)
|
|
||||||
public tags: ManyToMany<typeof Tag>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public slug: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public likes: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'titleId',
|
|
||||||
})
|
|
||||||
public title: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public titleId: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'descriptionId',
|
|
||||||
})
|
|
||||||
public description: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public descriptionId: number
|
|
||||||
|
|
||||||
@belongsTo(() => File, {
|
|
||||||
foreignKey: 'coverId',
|
|
||||||
})
|
|
||||||
public cover: BelongsTo<typeof File>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public coverId: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'contentId',
|
|
||||||
})
|
|
||||||
public content: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public contentId: number
|
|
||||||
|
|
||||||
@belongsTo(() => PostColor, {
|
|
||||||
foreignKey: 'colorId',
|
|
||||||
})
|
|
||||||
public color: BelongsTo<typeof PostColor>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public colorId: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public readingTime: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public date: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
|
|
||||||
export default class PostColor extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public name: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,42 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo, ManyToMany } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column, manyToMany } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import File from 'App/Models/File'
|
|
||||||
import Tag from 'App/Models/Tag'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Project extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public name: string
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'descriptionId',
|
|
||||||
})
|
|
||||||
public description: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public descriptionId: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public url: string
|
|
||||||
|
|
||||||
@belongsTo(() => File, {
|
|
||||||
foreignKey: 'coverId',
|
|
||||||
})
|
|
||||||
public cover: BelongsTo<typeof File>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public coverId: number
|
|
||||||
|
|
||||||
@manyToMany(() => Tag)
|
|
||||||
public tags: ManyToMany<typeof Tag>
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,27 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import File from 'App/Models/File'
|
|
||||||
|
|
||||||
export default class Skill extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public name: string
|
|
||||||
|
|
||||||
@belongsTo(() => File)
|
|
||||||
public file: BelongsTo<typeof File>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public fileId: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public color: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
|
|
||||||
export default class Subscriber extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public email: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import type { BelongsTo } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import { BaseModel, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export default class Tag extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@belongsTo(() => Translation, {
|
|
||||||
foreignKey: 'labelId',
|
|
||||||
})
|
|
||||||
public label: BelongsTo<typeof Translation>
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public labelId: number
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,22 +0,0 @@
|
|||||||
import type { DateTime } from 'luxon'
|
|
||||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
|
||||||
|
|
||||||
export default class Translation extends BaseModel {
|
|
||||||
@column({ isPrimary: true })
|
|
||||||
public id: number
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public code: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public french: string
|
|
||||||
|
|
||||||
@column()
|
|
||||||
public english: string
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true })
|
|
||||||
public createdAt: DateTime
|
|
||||||
|
|
||||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
|
||||||
public updatedAt: DateTime
|
|
||||||
}
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
import Translation from 'App/Models/Translation'
|
|
||||||
|
|
||||||
export async function getTranslation(code: string): Promise<Translation> {
|
|
||||||
return await Translation.firstOrNew({ code }, { code })
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class AnnounceUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
code: schema.string.optional(),
|
|
||||||
cover: schema.string.optional(),
|
|
||||||
color: schema.string.optional(),
|
|
||||||
hoverColor: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class ExperienceStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
title: schema.string(),
|
|
||||||
company: schema.string(),
|
|
||||||
location: schema.string(),
|
|
||||||
beginDate: schema.string(),
|
|
||||||
endDate: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class ExperienceUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
title: schema.string.optional(),
|
|
||||||
company: schema.string.optional(),
|
|
||||||
location: schema.string.optional(),
|
|
||||||
beginDate: schema.string.optional(),
|
|
||||||
endDate: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class FormStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string(),
|
|
||||||
email: schema.string(),
|
|
||||||
subject: schema.string(),
|
|
||||||
content: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class FormationStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
title: schema.string(),
|
|
||||||
description: schema.string(),
|
|
||||||
location: schema.string(),
|
|
||||||
beginDate: schema.string(),
|
|
||||||
endDate: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class FormationUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
title: schema.string.optional(),
|
|
||||||
description: schema.string.optional(),
|
|
||||||
location: schema.string.optional(),
|
|
||||||
beginDate: schema.string.optional(),
|
|
||||||
endDate: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class InformationUpdateValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
age: schema.number.optional(),
|
|
||||||
code: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,16 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class MaintenanceUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
reason: schema.string.optional(),
|
|
||||||
active: schema.boolean.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class PostStoreValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
slug: schema.string(),
|
|
||||||
likes: schema.number(),
|
|
||||||
tags: schema.array().members(schema.string()),
|
|
||||||
title: schema.string(),
|
|
||||||
description: schema.string(),
|
|
||||||
cover: schema.string(),
|
|
||||||
readingTime: schema.number(),
|
|
||||||
date: schema.string(),
|
|
||||||
color: schema.string(),
|
|
||||||
content: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,24 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class PostUpdateValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
slug: schema.string.optional(),
|
|
||||||
likes: schema.number.optional(),
|
|
||||||
tags: schema.array.optional().members(schema.string()),
|
|
||||||
title: schema.string.optional(),
|
|
||||||
description: schema.string.optional(),
|
|
||||||
cover: schema.string.optional(),
|
|
||||||
readingTime: schema.number.optional(),
|
|
||||||
date: schema.string.optional(),
|
|
||||||
color: schema.string.optional(),
|
|
||||||
content: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class PostColorStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class PostColorUpdateValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class ProjectStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string(),
|
|
||||||
description: schema.string(),
|
|
||||||
url: schema.string(),
|
|
||||||
cover: schema.string(),
|
|
||||||
tags: schema.array.optional().members(schema.string()),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,19 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class ProjectUpdateValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string.optional(),
|
|
||||||
description: schema.string.optional(),
|
|
||||||
url: schema.string.optional(),
|
|
||||||
cover: schema.string.optional(),
|
|
||||||
tags: schema.array.optional().members(schema.string()),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class SkillStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string(),
|
|
||||||
cover: schema.string(),
|
|
||||||
color: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class SkillUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
name: schema.string.optional(),
|
|
||||||
cover: schema.string.optional(),
|
|
||||||
color: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
import { schema } from '@ioc:Adonis/Core/Validator'
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
||||||
|
|
||||||
export default class StateSleepingValidator {
|
export default class StateValidator {
|
||||||
constructor(protected ctx: HttpContextContract) {
|
constructor(protected ctx: HttpContextContract) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1,21 +0,0 @@
|
|||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
|
|
||||||
export default class SubscriberStoreValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
email: schema.string({ trim: true }, [
|
|
||||||
rules.email(),
|
|
||||||
rules.unique({
|
|
||||||
table: 'subscribers',
|
|
||||||
column: 'email',
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class TagStoreValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
label: schema.string(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,15 +0,0 @@
|
|||||||
import { schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class TagUpdateValidator {
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
|
|
||||||
public schema = schema.create({
|
|
||||||
label: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
required: 'The field {{field}} is required',
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class TranslationStoreValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
code: schema.string({}, [
|
|
||||||
rules.unique({
|
|
||||||
table: 'translations',
|
|
||||||
column: 'code',
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
english: schema.string.optional(),
|
|
||||||
french: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
'required': 'The field {{field}} is required',
|
|
||||||
'code.unique': 'The translation code is not unique !',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@@ -1,23 +0,0 @@
|
|||||||
import { rules, schema } from '@ioc:Adonis/Core/Validator'
|
|
||||||
import type { HttpContextContract } from '@ioc:Adonis/Core/HttpContext'
|
|
||||||
|
|
||||||
export default class TranslationUpdateValidator {
|
|
||||||
public schema = schema.create({
|
|
||||||
code: schema.string({}, [
|
|
||||||
rules.unique({
|
|
||||||
table: 'translations',
|
|
||||||
column: 'code',
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
english: schema.string.optional(),
|
|
||||||
french: schema.string.optional(),
|
|
||||||
})
|
|
||||||
|
|
||||||
public messages = {
|
|
||||||
'required': 'The field {{field}} is required',
|
|
||||||
'code.unique': 'The translation code is not unique !',
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(protected ctx: HttpContextContract) {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
32
package.json
32
package.json
@@ -12,35 +12,35 @@
|
|||||||
"lint": "npx eslint --ext .json,.ts --fix ."
|
"lint": "npx eslint --ext .json,.ts --fix ."
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@adonisjs/auth": "^8.2.1",
|
"@adonisjs/auth": "^8.2.3",
|
||||||
"@adonisjs/bouncer": "^2.3.0",
|
"@adonisjs/bouncer": "^2.3.0",
|
||||||
"@adonisjs/core": "^5.8.4",
|
"@adonisjs/core": "^5.8.8",
|
||||||
"@adonisjs/lucid": "^18.1.0",
|
"@adonisjs/lucid": "^18.2.0",
|
||||||
"@adonisjs/mail": "^8.1.2",
|
"@adonisjs/mail": "^8.1.2",
|
||||||
"@adonisjs/redis": "^7.3.0",
|
"@adonisjs/redis": "^7.3.1",
|
||||||
"@adonisjs/repl": "^3.1.11",
|
"@adonisjs/repl": "^3.1.11",
|
||||||
"@adonisjs/session": "^6.4.0",
|
"@adonisjs/session": "^6.4.0",
|
||||||
"@adonisjs/view": "^6.1.6",
|
"@adonisjs/view": "^6.2.0",
|
||||||
"axios": "^0.27.2",
|
"axios": "^1.1.3",
|
||||||
"deep-object-diff": "^1.1.7",
|
"deep-object-diff": "^1.1.7",
|
||||||
"luxon": "^2.3.2",
|
"luxon": "^3.0.4",
|
||||||
"mjml": "^4.12.0",
|
"mjml": "^4.13.0",
|
||||||
"mysql": "^2.18.1",
|
"mysql": "^2.18.1",
|
||||||
"phc-argon2": "^1.1.3",
|
"phc-argon2": "^1.1.3",
|
||||||
"pretty-list-routes": "^0.0.5",
|
"pretty-list-routes": "^0.0.5",
|
||||||
"proxy-addr": "^2.0.7",
|
"proxy-addr": "^2.0.7",
|
||||||
"query-string": "^7.1.1",
|
"query-string": "^7.1.1",
|
||||||
"reflect-metadata": "^0.1.13",
|
"reflect-metadata": "^0.1.13",
|
||||||
"tslib": "^2.3.1"
|
"tslib": "^2.4.0"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@adonisjs/assembler": "^5.4.2",
|
"@adonisjs/assembler": "^5.9.3",
|
||||||
"@antfu/eslint-config": "^0.25.2",
|
"@antfu/eslint-config": "^0.27.0",
|
||||||
"adonis-preset-ts": "^2.1.0",
|
"adonis-preset-ts": "^2.1.0",
|
||||||
"eslint": "^8.19.0",
|
"eslint": "^8.26.0",
|
||||||
"pino-pretty": "^8.1.0",
|
"pino-pretty": "^9.1.1",
|
||||||
"typescript": "^4.7.4",
|
"typescript": "^4.8.4",
|
||||||
"youch": "^3.2.0",
|
"youch": "^3.2.2",
|
||||||
"youch-terminal": "^2.1.4"
|
"youch-terminal": "^2.1.5"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,12 +19,11 @@ Route.group(() => {
|
|||||||
Route.group(() => {
|
Route.group(() => {
|
||||||
Route.resource('/users', 'UsersController').except(['edit', 'create'])
|
Route.resource('/users', 'UsersController').except(['edit', 'create'])
|
||||||
|
|
||||||
Route.resource('/translations', 'TranslationsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/files', 'FilesController').only(['index', 'store', 'destroy'])
|
Route.resource('/files', 'FilesController').only(['index', 'store', 'destroy'])
|
||||||
|
|
||||||
Route.group(() => {
|
Route.group(() => {
|
||||||
Route.post('/sleeping', 'StatesController.setSleeping')
|
Route.post('/sleep', 'StatesController.setSleep')
|
||||||
|
Route.post('/sport', 'StatesController.setSport')
|
||||||
}).prefix('states')
|
}).prefix('states')
|
||||||
|
|
||||||
Route.group(() => {
|
Route.group(() => {
|
||||||
|
|||||||
@@ -1,32 +0,0 @@
|
|||||||
import Route from '@ioc:Adonis/Core/Route'
|
|
||||||
|
|
||||||
Route.group(() => {
|
|
||||||
Route.resource('/form', 'FormsController').except(['edit', 'create', 'update'])
|
|
||||||
|
|
||||||
Route.resource('/announce', 'AnnouncesController').only(['index', 'update'])
|
|
||||||
|
|
||||||
Route.resource('/maintenance', 'MaintenancesController').only(['index', 'update'])
|
|
||||||
|
|
||||||
Route.resource('/colors', 'PostColorsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/experiences', 'ExperiencesController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/formations', 'FormationsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/tags', 'TagsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/skills', 'SkillsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/projects', 'ProjectsController').except(['edit', 'create'])
|
|
||||||
|
|
||||||
Route.resource('/informations', 'InformationsController').only(['index', 'update'])
|
|
||||||
|
|
||||||
Route.resource('/posts', 'PostsController').except(['edit', 'create'])
|
|
||||||
Route.group(() => {
|
|
||||||
Route.get('/:slug/data', 'PostsController.get')
|
|
||||||
Route.post('/:slug/like', 'PostsController.like')
|
|
||||||
Route.post('/:slug/unlike', 'PostsController.unlike')
|
|
||||||
}).prefix('/posts')
|
|
||||||
|
|
||||||
Route.resource('/subscribers', 'SubscribersController').only(['index', 'store', 'destroy'])
|
|
||||||
}).middleware('auth:web,api')
|
|
||||||
@@ -1,4 +1,3 @@
|
|||||||
import './artsite'
|
|
||||||
import './api'
|
import './api'
|
||||||
import './auth'
|
import './auth'
|
||||||
import './home'
|
import './home'
|
||||||
|
|||||||
Reference in New Issue
Block a user