WikiTree: added photos

This commit is contained in:
Przemek Wiech
2020-01-20 00:06:11 +01:00
parent f454ca514b
commit 9587edf92d

View File

@@ -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;
}