mirror of
https://github.com/ArthurDanjou/artdanj-api.git
synced 2026-01-20 23:11:35 +01:00
Lint and update
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from "App/Models/File";
|
||||
import Translation from "App/Models/Translation";
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, 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 })
|
||||
@@ -14,7 +14,7 @@ export default class Announce extends BaseModel {
|
||||
public hoverColor: string
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'messageId'
|
||||
foreignKey: 'messageId',
|
||||
})
|
||||
public message: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -22,7 +22,7 @@ export default class Announce extends BaseModel {
|
||||
public messageId: number
|
||||
|
||||
@belongsTo(() => File, {
|
||||
foreignKey: 'coverId'
|
||||
foreignKey: 'coverId',
|
||||
})
|
||||
public cover: BelongsTo<typeof File>
|
||||
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import {BaseModel, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class DevelopmentHour extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from "App/Models/Translation";
|
||||
import { BaseModel, BelongsTo, 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'
|
||||
foreignKey: 'titleId',
|
||||
})
|
||||
public title: BelongsTo<typeof Translation>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class File extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from "App/Models/Translation";
|
||||
import { BaseModel, BelongsTo, 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'
|
||||
foreignKey: 'titleId',
|
||||
})
|
||||
public title: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -15,7 +15,7 @@ export default class Formation extends BaseModel {
|
||||
public titleId: number
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'descriptionId'
|
||||
foreignKey: 'descriptionId',
|
||||
})
|
||||
public description: BelongsTo<typeof Translation>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from "App/Models/Translation";
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Information extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from "App/Models/Translation";
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from 'App/Models/Translation'
|
||||
|
||||
export default class Maintenance extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
@@ -10,7 +10,7 @@ export default class Maintenance extends BaseModel {
|
||||
public active: boolean
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'reasonId'
|
||||
foreignKey: 'reasonId',
|
||||
})
|
||||
public reason: BelongsTo<typeof Translation>
|
||||
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column, manyToMany, 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";
|
||||
import { BaseModel, BelongsTo, belongsTo, column, manyToMany, 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 })
|
||||
@@ -19,7 +19,7 @@ export default class Post extends BaseModel {
|
||||
public likes: number
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'titleId'
|
||||
foreignKey: 'titleId',
|
||||
})
|
||||
public title: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -27,7 +27,7 @@ export default class Post extends BaseModel {
|
||||
public titleId: number
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'descriptionId'
|
||||
foreignKey: 'descriptionId',
|
||||
})
|
||||
public description: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -35,7 +35,7 @@ export default class Post extends BaseModel {
|
||||
public descriptionId: number
|
||||
|
||||
@belongsTo(() => File, {
|
||||
foreignKey: 'coverId'
|
||||
foreignKey: 'coverId',
|
||||
})
|
||||
public cover: BelongsTo<typeof File>
|
||||
|
||||
@@ -43,7 +43,7 @@ export default class Post extends BaseModel {
|
||||
public coverId: number
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'contentId'
|
||||
foreignKey: 'contentId',
|
||||
})
|
||||
public content: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -51,7 +51,7 @@ export default class Post extends BaseModel {
|
||||
public contentId: number
|
||||
|
||||
@belongsTo(() => PostColor, {
|
||||
foreignKey: 'colorId'
|
||||
foreignKey: 'colorId',
|
||||
})
|
||||
public color: BelongsTo<typeof PostColor>
|
||||
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column, ManyToMany, manyToMany} from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from "App/Models/File";
|
||||
import Tag from "App/Models/Tag";
|
||||
import Translation from "App/Models/Translation";
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, BelongsTo, belongsTo, column, ManyToMany, 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 })
|
||||
@@ -12,7 +12,7 @@ export default class Project extends BaseModel {
|
||||
public name: string
|
||||
|
||||
@belongsTo(() => Translation, {
|
||||
foreignKey: 'descriptionId'
|
||||
foreignKey: 'descriptionId',
|
||||
})
|
||||
public description: BelongsTo<typeof Translation>
|
||||
|
||||
@@ -23,7 +23,7 @@ export default class Project extends BaseModel {
|
||||
public url: string
|
||||
|
||||
@belongsTo(() => File, {
|
||||
foreignKey: 'coverId'
|
||||
foreignKey: 'coverId',
|
||||
})
|
||||
public cover: BelongsTo<typeof File>
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from "App/Models/File";
|
||||
import { BaseModel, BelongsTo, belongsTo, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
import File from 'App/Models/File'
|
||||
|
||||
export default class Skill extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
|
||||
@@ -1,13 +1,13 @@
|
||||
import { DateTime } from 'luxon'
|
||||
import {BaseModel, BelongsTo, belongsTo, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import Translation from "App/Models/Translation";
|
||||
import { BaseModel, BelongsTo, 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'
|
||||
foreignKey: 'labelId',
|
||||
})
|
||||
public label: BelongsTo<typeof Translation>
|
||||
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import {BaseModel, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import { DateTime } from 'luxon'
|
||||
import { BaseModel, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class Translation extends BaseModel {
|
||||
@column({ isPrimary: true })
|
||||
|
||||
@@ -1,9 +1,9 @@
|
||||
import {DateTime} from 'luxon'
|
||||
import { DateTime } from 'luxon'
|
||||
import Hash from '@ioc:Adonis/Core/Hash'
|
||||
import {BaseModel, beforeSave, column} from '@ioc:Adonis/Lucid/Orm'
|
||||
import { BaseModel, beforeSave, column } from '@ioc:Adonis/Lucid/Orm'
|
||||
|
||||
export default class User extends BaseModel {
|
||||
@column({isPrimary: true})
|
||||
@column({ isPrimary: true })
|
||||
public id: number
|
||||
|
||||
@column()
|
||||
@@ -24,16 +24,15 @@ export default class User extends BaseModel {
|
||||
@column()
|
||||
public rememberMeToken?: string
|
||||
|
||||
@column.dateTime({autoCreate: true})
|
||||
@column.dateTime({ autoCreate: true })
|
||||
public createdAt: DateTime
|
||||
|
||||
@column.dateTime({autoCreate: true, autoUpdate: true})
|
||||
@column.dateTime({ autoCreate: true, autoUpdate: true })
|
||||
public updatedAt: DateTime
|
||||
|
||||
@beforeSave()
|
||||
public static async hashPassword(user: User) {
|
||||
if (user.$dirty.password) {
|
||||
if (user.$dirty.password)
|
||||
user.password = await Hash.make(user.password)
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user