Skip to content

Commit

Permalink
Merge pull request #562 from shubham7101/zoro
Browse files Browse the repository at this point in the history
feat: zoro extra routes
  • Loading branch information
Eltik authored Jan 28, 2024
2 parents 0b33db1 + 570f27c commit 586424d
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion src/routes/anime/zoro.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,63 @@ const routes = async (fastify: FastifyInstance, options: RegisterOptions) => {
async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchRecentEpisodes(page);
const res = await zoro.fetchRecentlyUpdated(page);

reply.status(200).send(res);
},
);

fastify.get('/top-airing', async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchTopAiring(page);

reply.status(200).send(res);
});

fastify.get('/most-popular', async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchMostPopular(page);

reply.status(200).send(res);
});

fastify.get('/most-favorite', async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchMostFavorite(page);

reply.status(200).send(res);
});

fastify.get(
'/latest-completed',
async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchLatestCompleted(page);

reply.status(200).send(res);
},
);

fastify.get('/recent-added', async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchRecentlyAdded(page);

reply.status(200).send(res);
});

fastify.get('/top-upcoming', async (request: FastifyRequest, reply: FastifyReply) => {
const page = (request.query as { page: number }).page;

const res = await zoro.fetchTopUpcoming(page);

reply.status(200).send(res);
});

fastify.get('/info', async (request: FastifyRequest, reply: FastifyReply) => {
const id = (request.query as { id: string }).id;

Expand Down

0 comments on commit 586424d

Please sign in to comment.