chore: add prettier formatting
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s
All checks were successful
CI / Lint, typecheck and build (push) Successful in 9m56s
This commit is contained in:
@@ -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" },
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user