From 9587edf92deefc4cd4f2ce090b8a95110744b50e Mon Sep 17 00:00:00 2001 From: Przemek Wiech Date: Mon, 20 Jan 2020 00:06:11 +0100 Subject: [PATCH] WikiTree: added photos --- src/wikitree.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wikitree.ts b/src/wikitree.ts index 1c4f90d..eecf060 100644 --- a/src/wikitree.ts +++ b/src/wikitree.ts @@ -40,6 +40,9 @@ interface Person { BirthDate: string; DeathDate: string; }; + PhotoData?: { + path: string; + }; } /** Sends a request to the WikiTree API. Returns the parsed response JSON. */ @@ -245,6 +248,9 @@ function convertPerson(person: Person): JsonIndi { ); indi.death = Object.assign({}, parsedDate, {place: person.DeathLocation}); } + if (person.PhotoData) { + indi.images = [{url: `https://wikitree.com${person.PhotoData.path}`}]; + } return indi; }