Add moreInfo on tops

pull/3/head v3.1.2
Jéluchu 5 years ago
parent 078a75073b
commit 5c151093a9

@ -1,4 +1,4 @@
# **Aruppi API** (v3.1.1) # **Aruppi API** (v3.1.2)
> This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture > This API has everything about Japan, from anime, music, radio, images, videos ... to japanese culture
> >

@ -1,6 +1,6 @@
{ {
"name": "aruppi", "name": "aruppi",
"version": "3.1.1", "version": "3.1.2",
"description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app", "description": "Aruppi is a custom API to obtain data from the Japanese culture for the mobile app",
"main": "./src/api/api.js", "main": "./src/api/api.js",
"scripts": { "scripts": {

@ -42,18 +42,15 @@ const schedule = async (day) =>{
const top = async (top) =>{ const top = async (top) =>{
const data = await homgot(`${BASE_JIKAN}top/${top.type}/${top.page}/${top.subtype}`, { parse: true }); let data
return data.top.map(doc => ({ if (top.subtype !== undefined) {
rank: doc.rank, data = await homgot(`${BASE_JIKAN}top/${top.type}/${top.page}/${top.subtype}`, { parse: true });
title: doc.title, } else {
image: doc.image_url, data = await homgot(`${BASE_JIKAN}top/${top.type}/${top.page}`, { parse: true });
type: doc.type, }
score: doc.score,
link: doc.url, return data.top
startDate: doc.start_date,
endDate: doc.end_date
}));
}; };

@ -23,7 +23,7 @@ router.get('/schedule/:day' , (req, res) =>{
}); });
router.get('/top/:type/:subtype/:page' , (req, res) =>{ router.get('/top/:type/:subtype?/:page' , (req, res) =>{
let top = {type: req.params.type, subtype: req.params.subtype, page: req.params.page} let top = {type: req.params.type, subtype: req.params.subtype, page: req.params.page}

Loading…
Cancel
Save