Added basic actor and network overview. Added DDF Network actor scraper. Various bug fixes and layout improvements.

This commit is contained in:
2019-11-30 05:55:32 +01:00
parent 0dbe853f39
commit bead69de49
44 changed files with 1697 additions and 527 deletions

View File

@@ -6,10 +6,22 @@ async function fetchActorsApi(req, res) {
const actorId = typeof req.params.actorId === 'number' ? req.params.actorId : null;
const actorSlug = typeof req.params.actorId === 'string' ? req.params.actorId : null;
const actors = await fetchActors({
id: actorId,
slug: actorSlug,
});
if (actorId || actorSlug) {
const actors = await fetchActors({
id: actorId,
slug: actorSlug,
});
if (actors.length > 0) {
res.send(actors[0]);
return;
}
res.status(404).send();
return;
}
const actors = await fetchActors();
res.send(actors);
}