chore: add prettier formatting
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s

This commit is contained in:
zv
2026-06-14 20:26:56 +02:00
parent 8bbd9397a1
commit ee55521803
79 changed files with 2451 additions and 969 deletions

View File

@@ -1,14 +1,7 @@
import { NextResponse } from "next/server";
import { isImgwNoProductsResponse, readImgwResponseBody } from "@/lib/imgw-empty-response";
const ALLOWED_PATHS = new Set([
"synop",
"hydro",
"meteo",
"warningsmeteo",
"warningshydro",
"product",
]);
const ALLOWED_PATHS = new Set(["synop", "hydro", "meteo", "warningsmeteo", "warningshydro", "product"]);
const IMGW_BASE_URL = "https://danepubliczne.imgw.pl/api/data";
const USER_AGENT = "wtr./1.0 (weather data proxy)";
@@ -30,7 +23,11 @@ export async function GET(_: Request, context: { params: Promise<{ path: string[
});
if (!response.ok) {
const body = await readImgwResponseBody(response);
if ((resource === "warningsmeteo" || resource === "warningshydro") && response.status === 404 && isImgwNoProductsResponse(body.json)) {
if (
(resource === "warningsmeteo" || resource === "warningshydro") &&
response.status === 404 &&
isImgwNoProductsResponse(body.json)
) {
return NextResponse.json([], {
headers: { "Cache-Control": "public, s-maxage=300, stale-while-revalidate=600" },
});