rework PR-comments

This commit is contained in:
Claus-Peter Hübner 2023-03-15 01:25:34 +01:00
parent 8e4d4cb9ab
commit e1c239cd08
4 changed files with 21 additions and 25 deletions

View File

@ -2,7 +2,6 @@ export enum RIGHTS {
LOGIN = 'LOGIN',
VERIFY_LOGIN = 'VERIFY_LOGIN',
BALANCE = 'BALANCE',
GET_COMMUNITY_INFO = 'GET_COMMUNITY_INFO',
COMMUNITIES = 'COMMUNITIES',
LIST_GDT_ENTRIES = 'LIST_GDT_ENTRIES',
EXIST_PID = 'EXIST_PID',

View File

@ -1,14 +1,14 @@
/* eslint-disable @typescript-eslint/no-unsafe-assignment */
/* eslint-disable @typescript-eslint/no-unsafe-call */
/* eslint-disable @typescript-eslint/no-unsafe-member-access */
/* eslint-disable @typescript-eslint/unbound-method */
/* eslint-disable @typescript-eslint/no-explicit-any */
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
import { getCommunities } from '@/seeds/graphql/queries'
import { Community as DbCommunity } from '@entity/Community'
import { testEnvironment } from '@test/helpers'
// jest.mock('@/config')
let query: any
// to do: We need a setup for the tests that closes the connection
@ -27,22 +27,6 @@ afterAll(async () => {
})
describe('CommunityResolver', () => {
const getCommunities = `
query {
getCommunities {
id
foreign
publicKey
url
lastAnnouncedAt
verifiedAt
lastErrorAt
createdAt
updatedAt
}
}
`
describe('getCommunities', () => {
let homeCom1: DbCommunity
let homeCom2: DbCommunity

View File

@ -10,12 +10,9 @@ export class CommunityResolver {
@Authorized([RIGHTS.COMMUNITIES])
@Query(() => [Community])
async getCommunities(): Promise<Community[]> {
const comList: Community[] = []
const dbCommunities: DbCommunity[] = await DbCommunity.find({ order: { id: 'ASC' } })
dbCommunities.forEach(async function (dbCom) {
const com = new Community(dbCom)
comList.push(com)
const dbCommunities: DbCommunity[] = await DbCommunity.find({
order: { foreign: 'ASC', publicKey: 'ASC', apiVersion: 'ASC' },
})
return comList
return dbCommunities.map((dbCom: DbCommunity) => new Community(dbCom))
}
}

View File

@ -133,6 +133,22 @@ export const communities = gql`
}
`
export const getCommunities = gql`
query {
getCommunities {
id
foreign
publicKey
url
lastAnnouncedAt
verifiedAt
lastErrorAt
createdAt
updatedAt
}
}
`
export const queryTransactionLink = gql`
query ($code: String!) {
queryTransactionLink(code: $code) {