forked from DebaucheryLibrarian/traxxx
Added basic actor and network overview. Added DDF Network actor scraper. Various bug fixes and layout improvements.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user