feat: upgrade to TypeORM 0.3
This commit is contained in:
parent
8cee4ec1e4
commit
761ff27771
57 changed files with 412 additions and 325 deletions
|
@ -1,10 +1,11 @@
|
|||
import crypto from "crypto";
|
||||
import moment from "moment-timezone";
|
||||
import { getRepository, Repository } from "typeorm";
|
||||
import { Repository } from "typeorm";
|
||||
// tslint:disable-next-line:no-submodule-imports
|
||||
import uuidv4 from "uuid/v4";
|
||||
import { DAYS, DBDateFormat } from "../utils";
|
||||
import { BaseRepository } from "./BaseRepository";
|
||||
import { dataSource } from "./dataSource";
|
||||
import { ApiLogin } from "./entities/ApiLogin";
|
||||
|
||||
const LOGIN_EXPIRY_TIME = 1 * DAYS;
|
||||
|
@ -14,7 +15,7 @@ export class ApiLogins extends BaseRepository {
|
|||
|
||||
constructor() {
|
||||
super();
|
||||
this.apiLogins = getRepository(ApiLogin);
|
||||
this.apiLogins = dataSource.getRepository(ApiLogin);
|
||||
}
|
||||
|
||||
async getUserIdByApiKey(apiKey: string): Promise<string | null> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue