mirror of
https://github.com/IT4Change/gradido.git
synced 2026-02-06 09:56:05 +00:00
Merge branch 'refactor_community_auth' into refactor_community
This commit is contained in:
commit
f4c99572bd
@ -12,7 +12,6 @@ export class Community {
|
||||
this.creationDate = dbCom.creationDate
|
||||
this.uuid = dbCom.communityUuid
|
||||
this.authenticatedAt = dbCom.authenticatedAt
|
||||
// this.gmsApiKey = dbCom.gmsApiKey //
|
||||
this.hieroTopicId = dbCom.hieroTopicId
|
||||
}
|
||||
|
||||
@ -40,10 +39,6 @@ export class Community {
|
||||
@Field(() => Date, { nullable: true })
|
||||
authenticatedAt: Date | null
|
||||
|
||||
// gms api key should only seen by admins, they can use AdminCommunityView
|
||||
// @Field(() => String, { nullable: true })
|
||||
// gmsApiKey: string | null
|
||||
|
||||
@Field(() => String, { nullable: true })
|
||||
hieroTopicId: string | null
|
||||
}
|
||||
|
||||
@ -227,6 +227,14 @@ describe('CommunityResolver', () => {
|
||||
let foreignCom4: DbFederatedCommunity
|
||||
|
||||
beforeEach(async () => {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
jest.clearAllMocks()
|
||||
await userFactory(testEnv, peterLustig)
|
||||
// login as admin
|
||||
await mutate({ mutation: login, variables: peterLoginData })
|
||||
|
||||
>>>>>>> refactor_community_auth
|
||||
comHomeCom1 = DbCommunity.create()
|
||||
comHomeCom1.foreign = false
|
||||
comHomeCom1.url = 'http://localhost'
|
||||
|
||||
@ -24,6 +24,24 @@ import { CONFIG } from '@/config'
|
||||
|
||||
@Resolver()
|
||||
export class CommunityResolver {
|
||||
<<<<<<< HEAD
|
||||
=======
|
||||
@Authorized([RIGHTS.COMMUNITIES])
|
||||
@Query(() => [FederatedCommunity])
|
||||
async getCommunities(): Promise<FederatedCommunity[]> {
|
||||
const dbFederatedCommunities: DbFederatedCommunity[] = await DbFederatedCommunity.find({
|
||||
order: {
|
||||
foreign: 'ASC',
|
||||
createdAt: 'DESC',
|
||||
lastAnnouncedAt: 'DESC',
|
||||
},
|
||||
})
|
||||
return dbFederatedCommunities.map(
|
||||
(dbCom: DbFederatedCommunity) => new FederatedCommunity(dbCom),
|
||||
)
|
||||
}
|
||||
|
||||
>>>>>>> refactor_community_auth
|
||||
@Authorized([RIGHTS.COMMUNITY_WITH_API_KEYS])
|
||||
@Query(() => [AdminCommunityView])
|
||||
async allCommunities(@Args() paginated: Paginated): Promise<AdminCommunityView[]> {
|
||||
@ -95,7 +113,10 @@ export class CommunityResolver {
|
||||
}
|
||||
await DbCommunity.save(homeCom)
|
||||
}
|
||||
<<<<<<< HEAD
|
||||
|
||||
=======
|
||||
>>>>>>> refactor_community_auth
|
||||
return new AdminCommunityView(homeCom)
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user