dht node running on ne typeorm version

This commit is contained in:
Moriz Wahl 2023-06-26 14:04:32 +02:00
parent e35104faa8
commit ec4b8294b2
3 changed files with 6 additions and 6 deletions

View File

@ -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 () => {

View File

@ -217,7 +217,7 @@ async function writeFederatedHomeCommunityEntries(pubKey: string): Promise<Commu
async function writeHomeCommunityEntry(keyPair: KeyPair): Promise<void> {
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

View File

@ -3,7 +3,7 @@ import { logger } from '@/server/logger'
const getDBVersion = async (): Promise<string | null> => {
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)