UPDATE: monster bar
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m36s
Some checks failed
Gitea Auto Deploy / Deploy-Container (push) Failing after 1m36s
This commit is contained in:
18
src/app/api/[locale]/as/[id]/route.ts
Normal file
18
src/app/api/[locale]/as/[id]/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadAS } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const asData = await loadAS([id], locale)
|
||||
const as = asData[id]
|
||||
|
||||
if (!as) {
|
||||
return NextResponse.json({ error: 'AS info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return NextResponse.json(as)
|
||||
}
|
||||
20
src/app/api/[locale]/as/route.ts
Normal file
20
src/app/api/[locale]/as/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { loadAS } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const asIds = body.asIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(asIds) || asIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid asIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const asData = await loadAS(asIds, locale);
|
||||
|
||||
return NextResponse.json(asData);
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load as data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadCharacters } from '@/lib/characterLoader'
|
||||
import { loadCharacters } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadCharacters } from "@/lib/characterLoader";
|
||||
import { loadCharacters } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadLightcones } from '@/lib/lighconeLoader'
|
||||
import { loadLightcones } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadLightcones } from "@/lib/lighconeLoader";
|
||||
import { loadLightcones } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
|
||||
18
src/app/api/[locale]/moc/[id]/route.ts
Normal file
18
src/app/api/[locale]/moc/[id]/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadMOC } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const mocData = await loadMOC([id], locale)
|
||||
const moc = mocData[id]
|
||||
|
||||
if (!moc) {
|
||||
return NextResponse.json({ error: 'MOC info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return NextResponse.json(moc)
|
||||
}
|
||||
20
src/app/api/[locale]/moc/route.ts
Normal file
20
src/app/api/[locale]/moc/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { loadMOC } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const mocIds = body.mocIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(mocIds) || mocIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid mocIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const mocData = await loadMOC(mocIds, locale);
|
||||
|
||||
return NextResponse.json(mocData);
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load moc data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
18
src/app/api/[locale]/pf/[id]/route.ts
Normal file
18
src/app/api/[locale]/pf/[id]/route.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadPF } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
{ params }: { params: Promise<{ id: string, locale: string }> }
|
||||
) {
|
||||
|
||||
const { id, locale } = await params
|
||||
const pfData = await loadPF([id], locale)
|
||||
const pf = pfData[id]
|
||||
|
||||
if (!pf) {
|
||||
return NextResponse.json({ error: 'PF info not found' }, { status: 404 })
|
||||
}
|
||||
|
||||
return NextResponse.json(pf)
|
||||
}
|
||||
20
src/app/api/[locale]/pf/route.ts
Normal file
20
src/app/api/[locale]/pf/route.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { loadPF } from "@/lib/loader";
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
const body = await request.json();
|
||||
const pfIds = body.pfIds as string[];
|
||||
const { locale } = await params;
|
||||
|
||||
if (!Array.isArray(pfIds) || pfIds.some(id => typeof id !== 'string')) {
|
||||
return NextResponse.json({ error: 'Invalid pfIds' }, { status: 400 });
|
||||
}
|
||||
|
||||
const pfData = await loadPF(pfIds, locale);
|
||||
|
||||
return NextResponse.json(pfData);
|
||||
} catch {
|
||||
return NextResponse.json({ error: 'Failed to load pf data' }, { status: 500 });
|
||||
}
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from 'next/server'
|
||||
import { loadRelics } from '@/lib/relicLoader'
|
||||
import { loadRelics } from '@/lib/loader'
|
||||
|
||||
export async function GET(
|
||||
req: NextRequest,
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { NextRequest, NextResponse } from "next/server";
|
||||
import { loadRelics } from "@/lib/relicLoader";
|
||||
import { loadRelics } from "@/lib/loader";
|
||||
|
||||
export async function POST(request: NextRequest, { params }: { params: Promise<{ locale: string }> }) {
|
||||
try {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadConfigMaze } from "@/lib/configMazeLoader";
|
||||
import { loadConfigMaze } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadMainAffix } from "@/lib/affixLoader";
|
||||
import { loadMainAffix } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { loadSubAffix } from "@/lib/affixLoader";
|
||||
import { loadSubAffix } from "@/lib/loader";
|
||||
import { NextResponse } from "next/server";
|
||||
|
||||
export async function GET() {
|
||||
|
||||
Reference in New Issue
Block a user