This commit is contained in:
einhornimmond 2021-08-03 14:22:44 +02:00
parent 44bce32853
commit d2b4254015
3 changed files with 11 additions and 7 deletions

View File

@ -6,11 +6,11 @@ export class GdtTransactionInput {
email: string
@Field(() => Number)
firstPage: number
firstPage?: number
@Field(() => Number)
items: number
items?: number
@Field(() => String)
order: string
order?: string
}

View File

@ -21,9 +21,13 @@ export class GdtEntryList {
this.state = json.state
this.moreEntrysAsShown = json.moreEntrysAsShown
this.ownEntries = []
json.ownEntries.forEach((value: any) => {
this.ownEntries.push(new GdtEntry(value))
})
if (typeof json.ownEntries !== undefined) {
for (const entry in json.ownEntries) {
// eslint-disable-next-line no-console
console.log(entry)
this.ownEntries.push(new GdtEntry(json.ownEntries[entry]))
}
}
this.gdtSumPerEmail = []
for (const email in json.gdtSumPerEmail) {
this.gdtSumPerEmail.push(new GdtSumPerEmail(email, json.gdtSumPerEmail[email]))

View File

@ -3,7 +3,7 @@ import { Resolver, Query, /* Mutation, */ Args } from 'type-graphql'
import CONFIG from '../../config'
import { GdtEntryList } from '../models/GdtEntryList'
import { GdtTransactionInput } from '../inputs/GdtInputs'
import { apiPost, apiGet } from '../../apis/loginAPI'
import { apiGet } from '../../apis/loginAPI'
@Resolver()
export class GdtResolver {