Switched to tabs. Adding missing actor entries when scraping actors, with batch ID.
This commit is contained in:
@@ -3,29 +3,29 @@
|
||||
const { fetchActors } = require('../actors');
|
||||
|
||||
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 actorId = typeof req.params.actorId === 'number' ? req.params.actorId : null;
|
||||
const actorSlug = typeof req.params.actorId === 'string' ? req.params.actorId : null;
|
||||
|
||||
if (actorId || actorSlug) {
|
||||
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;
|
||||
}
|
||||
if (actors.length > 0) {
|
||||
res.send(actors[0]);
|
||||
return;
|
||||
}
|
||||
|
||||
res.status(404).send();
|
||||
return;
|
||||
}
|
||||
res.status(404).send();
|
||||
return;
|
||||
}
|
||||
|
||||
const actors = await fetchActors(null, req.query.limit);
|
||||
const actors = await fetchActors(null, req.query.limit);
|
||||
|
||||
res.send(actors);
|
||||
res.send(actors);
|
||||
}
|
||||
|
||||
module.exports = {
|
||||
fetchActors: fetchActorsApi,
|
||||
fetchActors: fetchActorsApi,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user