mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Removed the Group Model and Resolver since it is not used.
This commit is contained in:
parent
5c423f6c72
commit
68c0e7894d
@ -1,26 +0,0 @@
|
|||||||
import { Entity, BaseEntity, PrimaryGeneratedColumn, Column } from 'typeorm'
|
|
||||||
import { ObjectType, Field, ID } from 'type-graphql'
|
|
||||||
|
|
||||||
@Entity()
|
|
||||||
@ObjectType()
|
|
||||||
export class Group extends BaseEntity {
|
|
||||||
@Field(() => ID)
|
|
||||||
@PrimaryGeneratedColumn()
|
|
||||||
id: number
|
|
||||||
|
|
||||||
@Field(() => String)
|
|
||||||
@Column({ length: 190 })
|
|
||||||
alias: string
|
|
||||||
|
|
||||||
@Field(() => String)
|
|
||||||
@Column()
|
|
||||||
name: string
|
|
||||||
|
|
||||||
@Field(() => String)
|
|
||||||
@Column('text')
|
|
||||||
description: string
|
|
||||||
|
|
||||||
@Field(() => String)
|
|
||||||
@Column()
|
|
||||||
url: string
|
|
||||||
}
|
|
||||||
@ -1,23 +0,0 @@
|
|||||||
import { Resolver, Query, Mutation, Arg } from 'type-graphql'
|
|
||||||
import { Group } from '../models/Group'
|
|
||||||
import { loginAPI, NetworkInfosResult } from '../../apis/loginAPI'
|
|
||||||
@Resolver()
|
|
||||||
export class GroupResolver {
|
|
||||||
@Query(() => [Group])
|
|
||||||
async groups(): Promise<Group[]> {
|
|
||||||
const result: NetworkInfosResult = await loginAPI.getNetworkInfos(['groups'])
|
|
||||||
const groups: Group[] = []
|
|
||||||
|
|
||||||
result.data.groups?.forEach((alias: string) => {
|
|
||||||
const group = new Group()
|
|
||||||
group.alias = alias
|
|
||||||
groups.push(group)
|
|
||||||
})
|
|
||||||
return groups
|
|
||||||
}
|
|
||||||
|
|
||||||
@Query(() => Group)
|
|
||||||
group(@Arg('id') id: string): Promise<Group | undefined> {
|
|
||||||
return Group.findOne({ where: { id } })
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Loading…
x
Reference in New Issue
Block a user