Removed the Group Model and Resolver since it is not used.

This commit is contained in:
Hannes Heine 2021-07-29 07:28:44 +02:00
parent 5c423f6c72
commit 68c0e7894d
2 changed files with 0 additions and 49 deletions

View File

@ -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
}

View File

@ -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 } })
}
}