From c5cbb9e1204bb619a7b9aabde95df303823cd5a2 Mon Sep 17 00:00:00 2001 From: Ulf Gebhardt Date: Tue, 27 Jun 2023 22:18:56 +0200 Subject: [PATCH] rework GdtEntryList --- backend/src/graphql/model/GdtEntryList.ts | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/backend/src/graphql/model/GdtEntryList.ts b/backend/src/graphql/model/GdtEntryList.ts index 7c08520c8..adbe5dbc6 100644 --- a/backend/src/graphql/model/GdtEntryList.ts +++ b/backend/src/graphql/model/GdtEntryList.ts @@ -1,20 +1,15 @@ -/* eslint-disable @typescript-eslint/no-unsafe-call */ -/* eslint-disable @typescript-eslint/no-unsafe-member-access */ -/* eslint-disable @typescript-eslint/no-unsafe-assignment */ -/* eslint-disable @typescript-eslint/no-explicit-any */ -/* eslint-disable @typescript-eslint/explicit-module-boundary-types */ import { ObjectType, Field, Int, Float } from 'type-graphql' import { GdtEntry } from './GdtEntry' @ObjectType() export class GdtEntryList { - constructor(json: any) { - this.status = json.state - this.count = json.count - this.gdtEntries = json.gdtEntries ? json.gdtEntries.map((json: any) => new GdtEntry(json)) : [] - this.gdtSum = json.gdtSum - this.timeUsed = json.timeUsed + constructor(status = '', count = 0, gdtEntries = [], gdtSum = 0, timeUsed = 0) { + this.status = status + this.count = count + this.gdtEntries = gdtEntries + this.gdtSum = gdtSum + this.timeUsed = timeUsed } @Field(() => String)