mirror of
https://github.com/Radiquum/AniX.git
synced 2025-04-30 18:09:40 +05:00
New Home page, New UI, Proxy api requests through next.js api routes
This commit is contained in:
parent
49b9ac069f
commit
a30ddcfc6a
20 changed files with 5385 additions and 0 deletions
42
app/api/home/route.js
Normal file
42
app/api/home/route.js
Normal file
|
@ -0,0 +1,42 @@
|
|||
import { NextResponse } from "next/server";
|
||||
import { fetchDataViaPost } from "../utils";
|
||||
import { ENDPOINTS } from "../config";
|
||||
|
||||
export async function GET(request) {
|
||||
const page = parseInt(request.nextUrl.searchParams.get(["page"])) || 0;
|
||||
const status = request.nextUrl.searchParams.get(["status"]) || null;
|
||||
|
||||
let statusId;
|
||||
if (status == "last" || !status) {
|
||||
statusId = null;
|
||||
} else if (status == "finished") {
|
||||
statusId = 1;
|
||||
} else if (status == "ongoing") {
|
||||
statusId = 2;
|
||||
} else if (status == "announce") {
|
||||
statusId = 3;
|
||||
}
|
||||
|
||||
const data = {
|
||||
country: null,
|
||||
season: null,
|
||||
sort: 0,
|
||||
studio: null,
|
||||
age_ratings: [],
|
||||
category_id: null,
|
||||
end_year: null,
|
||||
episode_duration_from: null,
|
||||
episode_duration_to: null,
|
||||
episodes_from: null,
|
||||
episodes_to: null,
|
||||
genres: [],
|
||||
profile_list_exclusions: [],
|
||||
start_year: null,
|
||||
status_id: statusId,
|
||||
types: [],
|
||||
is_genres_exclude_mode_enabled: false,
|
||||
};
|
||||
|
||||
const response = await fetchDataViaPost(`${ENDPOINTS.filter}/${page}`, data);
|
||||
return NextResponse.json(response);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue