mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Created delete query.
This commit is contained in:
parent
e0ad9ab40a
commit
a618ac678e
@ -3,6 +3,7 @@ import gql from 'graphql-tag'
|
||||
export const getPendingCreations = gql`
|
||||
query {
|
||||
getPendingCreations {
|
||||
id
|
||||
firstName
|
||||
lastName
|
||||
email
|
||||
|
||||
@ -8,6 +8,7 @@ import { PendingCreationRepository } from '../../typeorm/repository/PendingCreat
|
||||
import { UserRepository } from '../../typeorm/repository/User'
|
||||
import CreatePendingCreationArgs from '../arg/CreatePendingCreationArgs'
|
||||
import moment from 'moment'
|
||||
import { LoginPendingTasksAdmin } from '@entity/LoginPendingTasksAdmin'
|
||||
|
||||
@Resolver()
|
||||
export class AdminResolver {
|
||||
@ -76,6 +77,15 @@ export class AdminResolver {
|
||||
)
|
||||
return pendingCreationsPromise
|
||||
}
|
||||
|
||||
@Query(() => Boolean)
|
||||
async deletePendingCreation(@Arg('id') id: number): Promise<boolean> {
|
||||
const pendingCreationRepository = getCustomRepository(PendingCreationRepository)
|
||||
const entity = await pendingCreationRepository.findOne(id)
|
||||
if (!entity) throw new Error('Not pending creation with this id.')
|
||||
const res = await pendingCreationRepository.manager.remove(entity)
|
||||
return res ? true : false
|
||||
}
|
||||
}
|
||||
|
||||
async function getUserCreations(id: number): Promise<number[]> {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user