mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Error in UpdatePendingCreationArgs changed export name, Added an InputType over the ArgsType for the CreatePendingCreationArgs, added a createPendingCreations mutation that creates multiple PendingCreation.
This commit is contained in:
parent
dddd467569
commit
9237f139f2
@ -1,5 +1,6 @@
|
||||
import { ArgsType, Field, Int } from 'type-graphql'
|
||||
import { ArgsType, Field, InputType, Int } from 'type-graphql'
|
||||
|
||||
@InputType()
|
||||
@ArgsType()
|
||||
export default class CreatePendingCreationArgs {
|
||||
@Field(() => String)
|
||||
|
||||
@ -1,7 +1,7 @@
|
||||
import { ArgsType, Field, Int } from 'type-graphql'
|
||||
|
||||
@ArgsType()
|
||||
export default class CreatePendingCreationArgs {
|
||||
export default class UpdatePendingCreationArgs {
|
||||
@Field(() => Int)
|
||||
id: number
|
||||
|
||||
|
||||
@ -62,6 +62,19 @@ export class AdminResolver {
|
||||
return await getUserCreations(user.id)
|
||||
}
|
||||
|
||||
// @Authorized([RIGHTS.SEARCH_USERS])
|
||||
@Mutation(() => Boolean)
|
||||
async createPendingCreations(
|
||||
@Arg('pendingCreations', () => [CreatePendingCreationArgs])
|
||||
pendingCreations: CreatePendingCreationArgs[],
|
||||
): Promise<boolean> {
|
||||
pendingCreations.forEach((pendingCreation) => {
|
||||
console.log('pendingCreation', pendingCreation)
|
||||
this.createPendingCreation(pendingCreation)
|
||||
})
|
||||
return true
|
||||
}
|
||||
|
||||
// @Authorized([RIGHTS.SEARCH_USERS])
|
||||
@Mutation(() => UpdatePendingCreation)
|
||||
async updatePendingCreation(
|
||||
@ -90,22 +103,6 @@ export class AdminResolver {
|
||||
result.creation = await getUserCreations(user.id)
|
||||
|
||||
return result
|
||||
|
||||
// const creations = await getUserCreations(user.id)
|
||||
// const creationDateObj = new Date(creationDate)
|
||||
// if (isCreationValid(creations, amount, creationDateObj)) {
|
||||
// const pendingCreationRepository = getCustomRepository(PendingCreationRepository)
|
||||
// const loginPendingTaskAdmin = pendingCreationRepository.create()
|
||||
// loginPendingTaskAdmin.userId = user.id
|
||||
// loginPendingTaskAdmin.amount = BigInt(amount * 10000)
|
||||
// loginPendingTaskAdmin.created = new Date()
|
||||
// loginPendingTaskAdmin.date = creationDateObj
|
||||
// loginPendingTaskAdmin.memo = memo
|
||||
// loginPendingTaskAdmin.moderator = moderator
|
||||
//
|
||||
// pendingCreationRepository.save(loginPendingTaskAdmin)
|
||||
// }
|
||||
// return await getUserCreations(user.id)
|
||||
}
|
||||
|
||||
@Query(() => [PendingCreation])
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user