mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Int as arg type for ID
This commit is contained in:
parent
8038f1bf9b
commit
7f6b7482b0
@ -1,7 +1,7 @@
|
||||
/* eslint-disable @typescript-eslint/no-explicit-any */
|
||||
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */
|
||||
|
||||
import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query } from 'type-graphql'
|
||||
import { Resolver, Args, Arg, Authorized, Ctx, Mutation, Query, Int } from 'type-graphql'
|
||||
import { TransactionLink } from '@model/TransactionLink'
|
||||
import { TransactionLink as dbTransactionLink } from '@entity/TransactionLink'
|
||||
import { User as dbUser } from '@entity/User'
|
||||
@ -70,7 +70,10 @@ export class TransactionLinkResolver {
|
||||
|
||||
@Authorized([RIGHTS.DELETE_TRANSACTION_LINK])
|
||||
@Mutation(() => Boolean)
|
||||
async deleteTransactionLink(@Arg('id') id: number, @Ctx() context: any): Promise<boolean> {
|
||||
async deleteTransactionLink(
|
||||
@Arg('id', () => Int) id: number,
|
||||
@Ctx() context: any,
|
||||
): Promise<boolean> {
|
||||
const { user } = context
|
||||
|
||||
const transactionLink = await dbTransactionLink.findOne({ id })
|
||||
@ -131,7 +134,10 @@ export class TransactionLinkResolver {
|
||||
|
||||
@Authorized([RIGHTS.REDEEM_TRANSACTION_LINK])
|
||||
@Mutation(() => Boolean)
|
||||
async redeemTransactionLink(@Arg('id') id: number, @Ctx() context: any): Promise<boolean> {
|
||||
async redeemTransactionLink(
|
||||
@Arg('id', () => Int) id: number,
|
||||
@Ctx() context: any,
|
||||
): Promise<boolean> {
|
||||
const { user } = context
|
||||
const transactionLink = await dbTransactionLink.findOneOrFail({ id })
|
||||
const linkedUser = await dbUser.findOneOrFail({ id: transactionLink.userId })
|
||||
|
||||
@ -73,13 +73,13 @@ export const createTransactionLink = gql`
|
||||
`
|
||||
|
||||
export const deleteTransactionLink = gql`
|
||||
mutation($id: Float!) {
|
||||
mutation($id: Int!) {
|
||||
deleteTransactionLink(id: $id)
|
||||
}
|
||||
`
|
||||
|
||||
export const redeemTransactionLink = gql`
|
||||
mutation($id: Float!) {
|
||||
mutation($id: Int!) {
|
||||
redeemTransactionLink(id: $id)
|
||||
}
|
||||
`
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user