mirror of
https://github.com/IT4Change/gradido.git
synced 2025-12-13 07:45:54 +00:00
Withdrew the community gdt call in apollo server and client definitions.
This commit is contained in:
parent
f9c3a5403c
commit
f93e62e412
@ -1,10 +1,8 @@
|
||||
import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql'
|
||||
import { Resolver, Query, Args } from 'type-graphql'
|
||||
import CONFIG from '../../config'
|
||||
import { TransactionList } from '../models/Transaction'
|
||||
import { TransactionListInput, TransactionSendArgs } from '../inputs/TransactionInput'
|
||||
import { apiGet, apiPost } from '../../apis/loginAPI'
|
||||
import { GdtEntryList } from '../models/GdtEntryList'
|
||||
import { GdtTransactionSessionIdInput } from '../inputs/GdtInputs'
|
||||
|
||||
@Resolver()
|
||||
export class TransactionResolver {
|
||||
@ -19,20 +17,6 @@ export class TransactionResolver {
|
||||
return new TransactionList(result.data)
|
||||
}
|
||||
|
||||
@Query(() => GdtEntryList)
|
||||
async gdtTransactionList(
|
||||
@Args()
|
||||
{ sessionId, currentPage = 1, pageSize = 25, order = 'DESC' }: GdtTransactionSessionIdInput,
|
||||
): Promise<GdtEntryList> {
|
||||
const result = await apiGet(
|
||||
`${CONFIG.COMMUNITY_API_URL}listGDTTransactions/${currentPage}/${pageSize}/${order}/${sessionId}`,
|
||||
)
|
||||
if (!result.success) {
|
||||
throw new Error(result.data)
|
||||
}
|
||||
return new GdtEntryList(result.data)
|
||||
}
|
||||
|
||||
@Query(() => String)
|
||||
async sendCoins(
|
||||
@Args() { sessionId, email, amount, memo }: TransactionSendArgs,
|
||||
|
||||
@ -124,28 +124,6 @@ export const checkUsername = gql`
|
||||
}
|
||||
`
|
||||
|
||||
export const gdtTransactionListQuery = gql`
|
||||
query($sessionId: Float!, $currentPage: Float!, $pageSize: Float!) {
|
||||
gdtTransactionList(sessionId: $sessionId, currentPage: $currentPage, pageSize: $pageSize) {
|
||||
state
|
||||
count
|
||||
gdtEntries {
|
||||
amount
|
||||
date
|
||||
email
|
||||
comment
|
||||
couponCode
|
||||
gdtEntryType
|
||||
factor
|
||||
amount2
|
||||
factor2
|
||||
gdt
|
||||
}
|
||||
gdtSum
|
||||
}
|
||||
}
|
||||
`
|
||||
|
||||
export const listGDTEntriesQuery = gql`
|
||||
query($email: String!, $currentPage: Float!, $pageSize: Float!) {
|
||||
listGDTEntries(email: $email, currentPage: $currentPage, pageSize: $pageSize) {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user