federation running with new typeorm version

This commit is contained in:
Moriz Wahl 2023-06-26 14:08:12 +02:00
parent ec4b8294b2
commit d5af6c3b21
2 changed files with 5 additions and 3 deletions

View File

@ -11,8 +11,10 @@ export class PublicKeyResolver {
async getPublicKey(): Promise<GetPublicKeyResult> {
logger.debug(`getPublicKey() via apiVersion=1_0 ...`)
const homeCom = await DbFederatedCommunity.findOneOrFail({
foreign: false,
apiVersion: '1_0',
where: {
foreign: false,
apiVersion: '1_0',
},
})
logger.info(`getPublicKey()-1_0... return publicKey=${homeCom.publicKey}`)
return new GetPublicKeyResult(homeCom.publicKey.toString())

View File

@ -3,7 +3,7 @@ import { federationLogger as 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)