From e63aaf9edef960fea1eef5c42cc398f145353742 Mon Sep 17 00:00:00 2001 From: Henry Jobst Date: Sun, 10 Nov 2024 00:08:34 +0100 Subject: [PATCH 1/5] feat(backend): start implementing cup calculation for nebel cup --- frontend/package.json | 2 +- pom.xml | 2 +- .../de/jobst/resulter/domain/ClassResult.java | 5 +- .../scoring/AddCalculationStrategy.java | 4 +- .../scoring/CupTypeCalculationStrategy.java | 4 +- .../scoring/KristallCalculationStrategy.java | 4 +- .../scoring/NORCalculationStrategy.java | 5 +- .../scoring/NebelCalculationStrategy.java | 50 +++++++++++++++++-- 8 files changed, 64 insertions(+), 12 deletions(-) diff --git a/frontend/package.json b/frontend/package.json index cb2a7b1..e8ec716 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -1,7 +1,7 @@ { "name": "resulter", "type": "module", - "version": "0.0.15", + "version": "0.0.17", "private": true, "packageManager": "pnpm@8.15.5", "scripts": { diff --git a/pom.xml b/pom.xml index 1e13976..a6d5e5c 100644 --- a/pom.xml +++ b/pom.xml @@ -11,7 +11,7 @@ de.jobst resulter - 0.0.16 + 0.0.17 resulter-api Backend for resulter web app diff --git a/src/main/java/de/jobst/resulter/domain/ClassResult.java b/src/main/java/de/jobst/resulter/domain/ClassResult.java index 11297d9..136c078 100644 --- a/src/main/java/de/jobst/resulter/domain/ClassResult.java +++ b/src/main/java/de/jobst/resulter/domain/ClassResult.java @@ -6,6 +6,7 @@ import java.util.Collection; import java.util.List; +import java.util.stream.Collectors; public record ClassResult(@NonNull ClassResultName classResultName, @NonNull ClassResultShortName classResultShortName, @NonNull Gender gender, @NonNull PersonResults personResults, @Nullable CourseId courseId) @@ -31,11 +32,13 @@ public int compareTo(@NonNull ClassResult o) { public List calculate(Cup cup, CupTypeCalculationStrategy cupTypeCalculationStrategy) { List personResults = this.personResults().value().stream().filter(cupTypeCalculationStrategy::valid).sorted().toList(); + var organisationByPerson = personResults.stream().collect(Collectors.toMap(PersonResult::personId, + v -> v.organisationId() != null ? v.organisationId() : null )); List personRaceResults = personResults.stream() .flatMap(it -> it.personRaceResults().value().stream()) .filter(y -> y.getState().equals(ResultStatus.OK)) .sorted() .toList(); - return cupTypeCalculationStrategy.calculate(cup, personRaceResults); + return cupTypeCalculationStrategy.calculate(cup, personRaceResults, organisationByPerson); } } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/AddCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/AddCalculationStrategy.java index 7a61c33..7317241 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/AddCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/AddCalculationStrategy.java @@ -3,6 +3,7 @@ import de.jobst.resulter.domain.*; import java.util.List; +import java.util.Map; public class AddCalculationStrategy implements CupTypeCalculationStrategy { @@ -17,7 +18,8 @@ public boolean valid(PersonResult personResult) { } @Override - public List calculate(Cup cup, List personRaceResults) { + public List calculate(Cup cup, List personRaceResults, + Map organisationByPerson) { return null; } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/CupTypeCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/CupTypeCalculationStrategy.java index e51f6e7..6ef48f4 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/CupTypeCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/CupTypeCalculationStrategy.java @@ -3,6 +3,7 @@ import de.jobst.resulter.domain.*; import java.util.List; +import java.util.Map; public interface CupTypeCalculationStrategy { @@ -10,5 +11,6 @@ public interface CupTypeCalculationStrategy { boolean valid(PersonResult personResult); - List calculate(Cup cup, List personRaceResults); + List calculate(Cup cup, List personRaceResults, + Map organisationByPerson); } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/KristallCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/KristallCalculationStrategy.java index c05e9cd..6277da4 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/KristallCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/KristallCalculationStrategy.java @@ -3,6 +3,7 @@ import de.jobst.resulter.domain.*; import java.util.List; +import java.util.Map; public class KristallCalculationStrategy implements CupTypeCalculationStrategy { @@ -17,7 +18,8 @@ public boolean valid(PersonResult personResult) { } @Override - public List calculate(Cup cup, List personRaceResults) { + public List calculate(Cup cup, List personRaceResults, + Map organisationByPerson) { return null; } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java index 168d87c..e270ff2 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java @@ -14,7 +14,7 @@ public class NORCalculationStrategy implements CupTypeCalculationStrategy { private final Map organisationById; private final Organisation norOrganisation; - Set classesToSkip = Set.of("BK", "BL", "Beg", "Trim", "Beginner"); + Set classesToSkip = Set.of("BK", "BL", "Beg", "Trim", "Beginner","OffK","OffL","D/H-12 Be"); public NORCalculationStrategy(Map organisationById) { this.organisationById = organisationById; @@ -72,7 +72,8 @@ public boolean valid(PersonResult personResult) { } @Override - public List calculate(Cup cup, List personRaceResults) { + public List calculate(Cup cup, List personRaceResults, + Map organisationByPerson) { if (personRaceResults.isEmpty()) { return List.of(); } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java index e0da651..db4e9d0 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java @@ -2,30 +2,72 @@ import de.jobst.resulter.domain.*; +import java.util.HashSet; import java.util.List; import java.util.Map; +import java.util.Set; public class NebelCalculationStrategy implements CupTypeCalculationStrategy { private final Map organisationById; + private final Organisation nebelOrganisation; + + Set classesToSkip = Set.of("BK", "BL", "Beg", "Trim", "Beginner", "OffK", "OffL", "D/H-12 Be"); public NebelCalculationStrategy(Map organisationById) { this.organisationById = organisationById; + nebelOrganisation = organisationById.values() + .stream() + .filter(x -> x.containsOrganisationWithShortName(CupType.NOR.value())) + .findFirst() + .orElse(null); } @Override public boolean valid(ClassResult classResult) { - return false; + return classesToSkip.stream().noneMatch(it -> classResult.classResultShortName().value().equals(it)); } @Override public boolean valid(PersonResult personResult) { - return false; + return true; // all organisations are excepted + /* + Optional optionalOrganisation = organisationById.containsKey(personResult.organisationId()) ? + Optional.of(organisationById.get(personResult.organisationId())) : + Optional.empty(); + return optionalOrganisation.isPresent() && nebelOrganisation != null && + nebelOrganisation.containsOrganisationWithId(optionalOrganisation.get().getId()); + */ } @Override - public List calculate(Cup cup, List personRaceResults) { + public List calculate(Cup cup, List personRaceResults, + Map organisationByPerson) { + if (personRaceResults.isEmpty()) { + return List.of(); + } + + PunchTime fastestTime = personRaceResults.getFirst().getRuntime(); + Set organisationWithScore = new HashSet<>(); + var personRaceResultsWithScore = personRaceResults.stream().filter(x -> { + OrganisationId organisationId = organisationByPerson.get(x.getPersonId()); + if (organisationId == null) { + // competitors without organisation are always in her own organisation + return true; + } + if (!organisationWithScore.contains(organisationId)) { + organisationWithScore.add(organisationId); + return true; + } + return false; + }).toList(); + + return personRaceResultsWithScore.stream().map(x -> calculateScore(x, fastestTime)).toList(); + } - return null; + private CupScore calculateScore(PersonRaceResult personRaceResult, PunchTime fastestTime) { + return CupScore.of(personRaceResult.getPersonId(), + personRaceResult.getClassResultShortName(), + NORCalculationStrategy.calculateNorPoints(fastestTime.value(), personRaceResult.getRuntime().value())); } } From 60352dd82b6a926923c163cbf4404c427da86053 Mon Sep 17 00:00:00 2001 From: Henry Jobst Date: Sun, 10 Nov 2024 14:49:01 +0100 Subject: [PATCH 2/5] fix(backend): fix queries on person_race_result for competitors with different organisations --- .../driven/jdbc/ResultListJdbcRepository.java | 68 +++++++++---------- 1 file changed, 32 insertions(+), 36 deletions(-) diff --git a/src/main/java/de/jobst/resulter/adapter/driven/jdbc/ResultListJdbcRepository.java b/src/main/java/de/jobst/resulter/adapter/driven/jdbc/ResultListJdbcRepository.java index 0146f70..b3bf35f 100644 --- a/src/main/java/de/jobst/resulter/adapter/driven/jdbc/ResultListJdbcRepository.java +++ b/src/main/java/de/jobst/resulter/adapter/driven/jdbc/ResultListJdbcRepository.java @@ -19,51 +19,47 @@ public interface ResultListJdbcRepository extends CrudRepository findAll(); @Query(""" - SELECT DISTINCT - rl.event_id, rl.id as result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status as result_list_status, - cl.short_name as class_list_short_name, cl.name as class_list_name, cl.gender as class_gender, cl.course_id, - pr.person_id, pr.organisation_id, - prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state - FROM result_list rl - LEFT JOIN class_result cl ON rl.id = cl.result_list_id - LEFT JOIN person_result pr ON rl.id = cl.result_list_id and pr.class_result_short_name = cl.short_name - LEFT JOIN person_race_result prr ON rl.id = prr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id - WHERE rl.id = :resultListId - AND prr.state != 'DID_NOT_START' - ORDER BY rl.id, cl.short_name, prr.race_number, prr.position, pr.person_id + SELECT DISTINCT + rl.event_id, rl.id AS result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status AS result_list_status, + cl.short_name AS class_list_short_name, cl.name AS class_list_name, cl.gender AS class_gender, cl.course_id, + pr.person_id, pr.organisation_id, + prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state + FROM person_race_result prr + INNER JOIN result_list rl ON rl.id = prr.result_list_id and rl.id = :resultListId + INNER JOIN class_result cl ON prr.result_list_id = cl.result_list_id and prr.class_result_short_name = cl.short_name + INNER JOIN person_result pr ON prr.result_list_id = pr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id + WHERE prr.state != 'DID_NOT_START' + ORDER BY rl.id, cl.short_name, prr.race_number, prr.position, pr.person_id; """) Collection findPersonRaceResultsByResultListId(@Param("resultListId") Long resultListId); @Query(""" SELECT - rl.event_id, rl.id as result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status as result_list_status, - cl.short_name as class_list_short_name, cl.name as class_list_name, cl.gender as class_gender, cl.course_id, - pr.person_id, pr.organisation_id, - prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state - FROM result_list rl - LEFT JOIN class_result cl ON rl.id = cl.result_list_id - LEFT JOIN person_result pr ON rl.id = cl.result_list_id and pr.class_result_short_name = cl.short_name - LEFT JOIN person_race_result prr ON rl.id = prr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id - WHERE rl.event_id = :eventId - AND prr.state != 'DID_NOT_START' - ORDER BY rl.id, cl.short_name, prr.race_number, prr.position, pr.person_id + rl.event_id, rl.id AS result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status AS result_list_status, + cl.short_name AS class_list_short_name, cl.name AS class_list_name, cl.gender AS class_gender, cl.course_id, + pr.person_id, pr.organisation_id, + prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state + FROM person_race_result prr + INNER JOIN result_list rl ON rl.id = prr.result_list_id and rl.event_id = :eventId + INNER JOIN class_result cl ON prr.result_list_id = cl.result_list_id and prr.class_result_short_name = cl.short_name + INNER JOIN person_result pr ON prr.result_list_id = pr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id + WHERE prr.state != 'DID_NOT_START' + ORDER BY rl.id, cl.short_name, prr.race_number, prr.position, pr.person_id; """) Collection findPersonRaceResultsByEventId(@Param("eventId") Long eventId); @Query(""" - SELECT DISTINCT - rl.event_id, rl.id as result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status as result_list_status, - cl.short_name as class_list_short_name, cl.name as class_list_name, cl.gender as class_gender, cl.course_id, - pr.person_id, pr.organisation_id, - prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state - FROM result_list rl - LEFT JOIN class_result cl ON rl.id = cl.result_list_id and cl.short_name = :classResultShortName - LEFT JOIN person_result pr ON rl.id = cl.result_list_id and pr.class_result_short_name = cl.short_name and pr.person_id = :personId - LEFT JOIN person_race_result prr ON rl.id = prr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id - WHERE rl.id = :resultListId - AND cl.short_name = :classResultShortName - AND pr.person_id = :personId - ORDER BY prr.race_number + SELECT + rl.event_id, rl.id AS result_list_id, rl.race_id, rl.create_time, rl.create_time_zone, rl.status AS result_list_status, + cl.short_name AS class_list_short_name, cl.name AS class_list_name, cl.gender AS class_gender, cl.course_id, + pr.person_id, pr.organisation_id, + prr.start_time, prr.start_time_zone, prr.punch_time, prr.position, prr.race_number, prr.state + FROM person_race_result prr + INNER JOIN result_list rl ON rl.id = prr.result_list_id and rl.id = :resultListId + INNER JOIN class_result cl ON prr.result_list_id = cl.result_list_id and prr.class_result_short_name = cl.short_name and cl.short_name = :classResultShortName + INNER JOIN person_result pr ON prr.result_list_id = pr.result_list_id and prr.class_result_short_name = pr.class_result_short_name and prr.person_id = pr.person_id and pr.person_id = :personId + WHERE prr.state != 'DID_NOT_START' + ORDER BY rl.id, prr.race_number, cl.short_name, prr.race_number, prr.position, pr.person_id; """) List findPersonRaceResultByResultListIdAndClassResultShortNameAndPersonId( @Param("resultListId") Long resultListId, From a2bef81adfd8ce9e9ea3f25a83b93329324608fd Mon Sep 17 00:00:00 2001 From: Henry Jobst Date: Sun, 10 Nov 2024 14:50:30 +0100 Subject: [PATCH 3/5] feat(backend): finalize nebel cup calculation --- .../scoring/NORCalculationStrategy.java | 2 +- .../scoring/NebelCalculationStrategy.java | 50 ++++++++----------- 2 files changed, 21 insertions(+), 31 deletions(-) diff --git a/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java index e270ff2..0b8471b 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/NORCalculationStrategy.java @@ -20,7 +20,7 @@ public NORCalculationStrategy(Map organisationById this.organisationById = organisationById; norOrganisation = organisationById.values() .stream() - .filter(x -> x.containsOrganisationWithShortName(CupType.NOR.value())) + .filter(x -> x.containsOrganisationWithShortName(CUP_TYPE.value())) .findFirst() .orElse(null); } diff --git a/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java b/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java index db4e9d0..f44cf30 100644 --- a/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java +++ b/src/main/java/de/jobst/resulter/domain/scoring/NebelCalculationStrategy.java @@ -1,26 +1,20 @@ package de.jobst.resulter.domain.scoring; import de.jobst.resulter.domain.*; +import lombok.extern.slf4j.Slf4j; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; +import java.util.*; +@Slf4j public class NebelCalculationStrategy implements CupTypeCalculationStrategy { private final Map organisationById; - private final Organisation nebelOrganisation; Set classesToSkip = Set.of("BK", "BL", "Beg", "Trim", "Beginner", "OffK", "OffL", "D/H-12 Be"); + Set organisationsToSkip = Set.of("ohne", "Volkssport"); public NebelCalculationStrategy(Map organisationById) { this.organisationById = organisationById; - nebelOrganisation = organisationById.values() - .stream() - .filter(x -> x.containsOrganisationWithShortName(CupType.NOR.value())) - .findFirst() - .orElse(null); } @Override @@ -30,14 +24,17 @@ public boolean valid(ClassResult classResult) { @Override public boolean valid(PersonResult personResult) { - return true; // all organisations are excepted - /* - Optional optionalOrganisation = organisationById.containsKey(personResult.organisationId()) ? - Optional.of(organisationById.get(personResult.organisationId())) : - Optional.empty(); - return optionalOrganisation.isPresent() && nebelOrganisation != null && - nebelOrganisation.containsOrganisationWithId(optionalOrganisation.get().getId()); - */ + if (personResult.organisationId() != null && (personResult.organisationId().value () == 131)) { + var org = organisationById.get(personResult.organisationId()); + log.debug(org.toString()); + } + Boolean result = Optional.ofNullable(organisationById.get(personResult.organisationId())) + .map(v -> { + boolean contains = organisationsToSkip.contains(v.getShortName().value()); + return !contains; + }) + .orElse(false); + return result; } @Override @@ -49,18 +46,11 @@ public List calculate(Cup cup, List personRaceResult PunchTime fastestTime = personRaceResults.getFirst().getRuntime(); Set organisationWithScore = new HashSet<>(); - var personRaceResultsWithScore = personRaceResults.stream().filter(x -> { - OrganisationId organisationId = organisationByPerson.get(x.getPersonId()); - if (organisationId == null) { - // competitors without organisation are always in her own organisation - return true; - } - if (!organisationWithScore.contains(organisationId)) { - organisationWithScore.add(organisationId); - return true; - } - return false; - }).toList(); + var personRaceResultsWithScore = personRaceResults.stream() + .filter(x -> Optional.ofNullable(organisationByPerson.get(x.getPersonId())) + .filter(organisationWithScore::add) // predicate will be applied only if Optional is not empty + .isPresent()) + .toList(); return personRaceResultsWithScore.stream().map(x -> calculateScore(x, fastestTime)).toList(); } From 831555546c1ae9728f174c0a7a304d0aa66b3f5d Mon Sep 17 00:00:00 2001 From: Henry Jobst Date: Sun, 10 Nov 2024 14:51:36 +0100 Subject: [PATCH 4/5] chore(backend): add test databases to .gitignore --- .gitignore | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.gitignore b/.gitignore index df838f2..fc5a537 100644 --- a/.gitignore +++ b/.gitignore @@ -43,3 +43,5 @@ src/main/.DS_Store /node_modules/** /build-with-act.sh /build-images-with-act.sh +/testdb.mv.db +/testdb.trace.db From 124d741654222bd5024824789eb3c8305bb587b8 Mon Sep 17 00:00:00 2001 From: Henry Jobst Date: Sun, 10 Nov 2024 15:05:09 +0100 Subject: [PATCH 5/5] fix(frontend): fix some backend urls --- .../features/event/services/event.service.ts | 35 +++++++++---------- 1 file changed, 16 insertions(+), 19 deletions(-) diff --git a/frontend/src/features/event/services/event.service.ts b/frontend/src/features/event/services/event.service.ts index 64fc03a..e264e5b 100644 --- a/frontend/src/features/event/services/event.service.ts +++ b/frontend/src/features/event/services/event.service.ts @@ -29,8 +29,7 @@ export class EventService extends GenericService { if (response) { const result = response result.content = result.content.map((element) => { - if (element.startTime) - element.startTime = new Date(element.startTime) + if (element.startTime) element.startTime = new Date(element.startTime) return element }) @@ -43,7 +42,7 @@ export class EventService extends GenericService { static async calculate(result_list_id: number, t: (key: string) => string) { return axiosInstance .put(`${resultListUrl}/${result_list_id}/calculate`) - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -53,7 +52,7 @@ export class EventService extends GenericService { static async getEventStatus(t: (key: string) => string): Promise { return await axiosInstance .get(eventStatusUrl) - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -71,12 +70,12 @@ export class EventService extends GenericService { response.data.resultLists = response.data.resultLists.map( (resultList: ResultList) => { if ( - resultList.createTime - && typeof resultList.createTime === 'string' + resultList.createTime && + typeof resultList.createTime === 'string' ) { // Entfernen des Zeitzone-Identifikators, da dieser nicht von Date.parse() unterstützt wird - const dateStringWithoutTimezone - = resultList.createTime.split('[')[0] + const dateStringWithoutTimezone = + resultList.createTime.split('[')[0] resultList.createTime = new Date(dateStringWithoutTimezone) } return resultList @@ -99,7 +98,7 @@ export class EventService extends GenericService { 'Content-Type': 'multipart/form-data', }, }) - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -148,11 +147,10 @@ export class EventService extends GenericService { } static async getCertificate(certificate: Certificate | undefined, t: (key: string) => string) { - if (!certificate || !certificate.event) - return null + if (!certificate || !certificate.event) return null return axiosInstance - .put(`/event/${certificate.event?.id}/certificate`, certificate, { + .put(`${eventUrl}/${certificate.event?.id}/certificate`, certificate, { responseType: 'blob', }) .then((response) => { @@ -174,8 +172,8 @@ export class EventService extends GenericService { return null } return axiosInstance - .get(`/${eventUrl}/${id}/certificate_stats`) - .then(response => response.data) + .get(`${eventUrl}/${id}/certificate_stats`) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -183,11 +181,10 @@ export class EventService extends GenericService { } static async removeEventCertificateStat(id: number, t: (key: string) => string) { - if (!id) - return null + if (!id) return null return axiosInstance .delete(`/event_certificate_stat/${id}`) - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -197,7 +194,7 @@ export class EventService extends GenericService { static async getCertificateSchema(t: (key: string) => string) { return axiosInstance .get('/certificate_schema') - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null @@ -213,7 +210,7 @@ export class EventService extends GenericService { } return axiosInstance .get(`${resultListUrl}/${id}/cup_score_lists`) - .then(response => response.data) + .then((response) => response.data) .catch((error) => { handleApiError(error, t) return null