Skip to content

Commit

Permalink
Address SonarCloud issues
Browse files Browse the repository at this point in the history
  • Loading branch information
myrotvorets-team committed Oct 8, 2023
1 parent 1307f2d commit fc71a6e
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/lib/db.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@ import { Knex, knex } from 'knex';
import { buildKnexConfig } from '../knexfile';
import type { Post } from '../lib/types';

let db: Knex | undefined = undefined;
let database: Knex | undefined = undefined;

export function getDB(): Knex {
if (db === undefined) {
db = knex(buildKnexConfig());
if (database === undefined) {
database = knex(buildKnexConfig());
}

return db;
return database;
}

export function addPost(db: Knex, postId: number): Promise<number[]> {
Expand Down

0 comments on commit fc71a6e

Please sign in to comment.