From d4085d608bcf76b09d2447ee1891102adaa2da8d Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 13 May 2024 18:45:43 +0200 Subject: [PATCH] Explicitly type MapRoulette challenge --- src/Logic/Maproulette.ts | 6 +++++- src/UI/SpecialVisualizations.ts | 4 ++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/Logic/Maproulette.ts b/src/Logic/Maproulette.ts index 195f52cb4..6f4e5f361 100644 --- a/src/Logic/Maproulette.ts +++ b/src/Logic/Maproulette.ts @@ -1,5 +1,9 @@ import Constants from "../Models/Constants" - +export interface MaprouletteTask { + name: string, + description: string, + instruction: string +} export default class Maproulette { public static readonly defaultEndpoint = "https://maproulette.org/api/v2" diff --git a/src/UI/SpecialVisualizations.ts b/src/UI/SpecialVisualizations.ts index 53c83c9bd..5d0f08f5e 100644 --- a/src/UI/SpecialVisualizations.ts +++ b/src/UI/SpecialVisualizations.ts @@ -35,7 +35,7 @@ import StatisticsPanel from "./BigComponents/StatisticsPanel" import AutoApplyButton from "./Popup/AutoApplyButton" import { LanguageElement } from "./Popup/LanguageElement/LanguageElement" import FeatureReviews from "../Logic/Web/MangroveReviews" -import Maproulette from "../Logic/Maproulette" +import Maproulette, { MaprouletteTask } from "../Logic/Maproulette" import SvelteUIElement from "./Base/SvelteUIElement" import { BBoxFeatureSourceForLayer } from "../Logic/FeatureSource/Sources/TouchesBboxFeatureSource" import { Feature, GeoJsonProperties } from "geojson" @@ -1039,7 +1039,7 @@ console.log(">>> ",helpTexts.join("\n\n")) return undefined } const challenge = Stores.FromPromise( - Utils.downloadJsonCached( + Utils.downloadJsonCached( `${Maproulette.defaultEndpoint}/challenge/${parentId}`, 24 * 60 * 60 * 1000 )