diff --git a/dht-node/src/dht_node/index.test.ts b/dht-node/src/dht_node/index.test.ts index ec172c4f8..c6e972c52 100644 --- a/dht-node/src/dht_node/index.test.ts +++ b/dht-node/src/dht_node/index.test.ts @@ -340,7 +340,7 @@ describe('federation', () => { }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbFederatedCommunity.find({ foreign: true }) + result = await DbFederatedCommunity.find({ where: { foreign: true } }) }) afterAll(async () => { @@ -601,7 +601,7 @@ describe('federation', () => { { api: 'toolong api', url: 'some valid url' }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbFederatedCommunity.find({ foreign: true }) + result = await DbFederatedCommunity.find({ where: { foreign: true } }) }) afterAll(async () => { @@ -655,7 +655,7 @@ describe('federation', () => { }, ] await socketEventMocks.data(Buffer.from(JSON.stringify(jsonArray))) - result = await DbFederatedCommunity.find({ foreign: true }) + result = await DbFederatedCommunity.find({ where: { foreign: true } }) }) afterAll(async () => { @@ -791,7 +791,7 @@ describe('federation', () => { ]), ), ) - result = await DbFederatedCommunity.find({ foreign: true }) + result = await DbFederatedCommunity.find({ where: { foreign: true } }) }) afterAll(async () => { diff --git a/dht-node/src/dht_node/index.ts b/dht-node/src/dht_node/index.ts index a767c323e..f24522c3b 100644 --- a/dht-node/src/dht_node/index.ts +++ b/dht-node/src/dht_node/index.ts @@ -217,7 +217,7 @@ async function writeFederatedHomeCommunityEntries(pubKey: string): Promise { try { // check for existing homeCommunity entry - let homeCom = await DbCommunity.findOne({ foreign: false }) + let homeCom = await DbCommunity.findOne({ where: { foreign: false } }) if (homeCom) { // simply update the existing entry, but it MUST keep the ID and UUID because of possible relations homeCom.publicKey = keyPair.publicKey diff --git a/dht-node/src/typeorm/DBVersion.ts b/dht-node/src/typeorm/DBVersion.ts index 5bd23c1d5..850c6ed80 100644 --- a/dht-node/src/typeorm/DBVersion.ts +++ b/dht-node/src/typeorm/DBVersion.ts @@ -3,7 +3,7 @@ import { logger } from '@/server/logger' const getDBVersion = async (): Promise => { try { - const dbVersion = await Migration.findOne({ order: { version: 'DESC' } }) + const [dbVersion] = await Migration.find({ order: { version: 'DESC' }, take: 1 }) return dbVersion ? dbVersion.fileName : null } catch (error) { logger.error(error)