chore: suit eslint rules
This commit is contained in:
@@ -1,5 +1,5 @@
|
||||
import { Model, snakeCaseMappers } from 'objection';
|
||||
import type { Constructor, TransactionOrKnex, QueryBuilderType, QueryContext, ModelOptions, ColumnNameMappers } from 'objection';
|
||||
import type { QueryContext, ModelOptions, ColumnNameMappers } from 'objection';
|
||||
|
||||
class Base extends Model {
|
||||
createdAt!: string;
|
||||
@@ -9,14 +9,14 @@ class Base extends Model {
|
||||
return snakeCaseMappers();
|
||||
}
|
||||
|
||||
async $beforeInsert(queryContext: QueryContext) {
|
||||
async $beforeInsert(queryContext: QueryContext): Promise<void> {
|
||||
await super.$beforeInsert(queryContext);
|
||||
|
||||
this.createdAt = new Date().toISOString();
|
||||
this.updatedAt = new Date().toISOString();
|
||||
}
|
||||
|
||||
async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext) {
|
||||
async $beforeUpdate(opt: ModelOptions, queryContext: QueryContext): Promise<void> {
|
||||
await super.$beforeUpdate(opt, queryContext);
|
||||
|
||||
this.updatedAt = new Date().toISOString();
|
||||
|
Reference in New Issue
Block a user