mirror of
https://github.com/IT4Change/gradido.git
synced 2026-03-01 12:44:43 +00:00
18 lines
603 B
TypeScript
18 lines
603 B
TypeScript
import { CommandExecutor, CommandResult, EncryptedTransferArgs } from 'core'
|
|
import { Arg, Ctx, Mutation, Resolver } from 'type-graphql'
|
|
|
|
@Resolver()
|
|
export class CommandResolver {
|
|
private commandExecutor = new CommandExecutor()
|
|
|
|
@Mutation(() => CommandResult)
|
|
async sendCommand(
|
|
@Arg('encryptedArgs', () => EncryptedTransferArgs) encryptedArgs: any,
|
|
@Ctx() context: any,
|
|
): Promise<CommandResult> {
|
|
// Convert to EncryptedTransferArgs if needed
|
|
const result = await this.commandExecutor.executeEncryptedCommand(encryptedArgs)
|
|
return result as unknown as CommandResult
|
|
}
|
|
}
|