mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
rework PR-comments
This commit is contained in:
parent
8e4d4cb9ab
commit
e1c239cd08
@ -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',
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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))
|
||||
}
|
||||
}
|
||||
|
||||
@ -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) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user