mirror of https://github.com/aruppi/aruppi-api
Add moreInfo on tops
This commit is contained in:
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
|
||||
>
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
{
|
||||
"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",
|
||||
"main": "./src/api/api.js",
|
||||
"scripts": {
|
||||
|
|
|
@ -42,18 +42,15 @@ const schedule = async (day) =>{
|
|||
|
||||
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 => ({
|
||||
rank: doc.rank,
|
||||
title: doc.title,
|
||||
image: doc.image_url,
|
||||
type: doc.type,
|
||||
score: doc.score,
|
||||
link: doc.url,
|
||||
startDate: doc.start_date,
|
||||
endDate: doc.end_date
|
||||
}));
|
||||
if (top.subtype !== undefined) {
|
||||
data = await homgot(`${BASE_JIKAN}top/${top.type}/${top.page}/${top.subtype}`, { parse: true });
|
||||
} else {
|
||||
data = await homgot(`${BASE_JIKAN}top/${top.type}/${top.page}`, { parse: true });
|
||||
}
|
||||
|
||||
return data.top
|
||||
|
||||
};
|
||||
|
||||
|
|
|
@ -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}
|
||||
|
||||
|
|
Loading…
Reference in New Issue