From 50da2333f8fa206709cb73d4bb0087f9a48d8229 Mon Sep 17 00:00:00 2001 From: Dudrie Date: Tue, 11 Feb 2020 22:11:09 +0100 Subject: [PATCH] Remove duplicate type "StudentScheinCriteriaSummaryMap" --- client/src/hooks/fetching/Tutorial.ts | 6 +++--- client/src/typings/types.ts | 4 ---- client/src/view/dashboard/Dashboard.tsx | 8 +++----- 3 files changed, 6 insertions(+), 12 deletions(-) diff --git a/client/src/hooks/fetching/Tutorial.ts b/client/src/hooks/fetching/Tutorial.ts index a0b728e1c..aac0e883d 100644 --- a/client/src/hooks/fetching/Tutorial.ts +++ b/client/src/hooks/fetching/Tutorial.ts @@ -1,10 +1,10 @@ +import { ScheincriteriaSummaryByStudents } from 'shared/dist/model/ScheinCriteria'; import { Student } from 'shared/dist/model/Student'; import { SubstituteDTO, Tutorial, TutorialDTO } from 'shared/dist/model/Tutorial'; import { TutorInfo, User } from 'shared/dist/model/User'; import { sortByName } from 'shared/dist/util/helpers'; import { StudentByTutorialSlotSummaryMap, - StudentScheinCriteriaSummaryMap, TutorialWithFetchedCorrectors, TutorialWithFetchedStudents, TutorialWithFetchedTutor, @@ -192,8 +192,8 @@ export async function getStudentsOfTutorial(id: string): Promise { export async function getScheinCriteriaSummariesOfAllStudentsOfTutorial( id: string -): Promise { - const response = await axios.get( +): Promise { + const response = await axios.get( `scheincriteria/tutorial/${id}` ); diff --git a/client/src/typings/types.ts b/client/src/typings/types.ts index bf6241190..8d2d45315 100644 --- a/client/src/typings/types.ts +++ b/client/src/typings/types.ts @@ -31,10 +31,6 @@ export interface HasPoints extends HasId { points: PointMapDTO; } -export interface StudentScheinCriteriaSummaryMap { - [id: string]: ScheinCriteriaSummary; -} - export interface StudentByTutorialSlotSummaryMap { [tutorialSlot: string]: ScheinCriteriaSummary[]; } diff --git a/client/src/view/dashboard/Dashboard.tsx b/client/src/view/dashboard/Dashboard.tsx index b0ee81c4a..07a888c7b 100644 --- a/client/src/view/dashboard/Dashboard.tsx +++ b/client/src/view/dashboard/Dashboard.tsx @@ -1,22 +1,20 @@ import React, { useEffect, useState } from 'react'; import { Role } from 'shared/dist/model/Role'; +import { ScheincriteriaSummaryByStudents } from 'shared/dist/model/ScheinCriteria'; import { Tutorial } from 'shared/dist/model/Tutorial'; import { LoggedInUser } from 'shared/dist/model/User'; import LoadingSpinner from '../../components/loading/LoadingSpinner'; import { getTutorial } from '../../hooks/fetching/Tutorial'; import { useAxios } from '../../hooks/FetchingService'; import { useLogin } from '../../hooks/LoginService'; -import { - StudentByTutorialSlotSummaryMap, - StudentScheinCriteriaSummaryMap, -} from '../../typings/types'; +import { StudentByTutorialSlotSummaryMap } from '../../typings/types'; import AdminStatsCard from './components/AdminStatsCard'; import AllTutorialStatistics from './components/AllTutorialStatistics'; import TutorialStatistics from './components/TutorialStatistics'; export interface TutorialSummaryInfo { tutorial: Tutorial; - studentInfos: StudentScheinCriteriaSummaryMap; + studentInfos: ScheincriteriaSummaryByStudents; } function isAdmin(userData: LoggedInUser | undefined): boolean {