Skip to content

Commit 65c744b

Browse files
committed
Feat: Add revalidation for river basins page and ensure empty array return on error
1 parent 70eb956 commit 65c744b

2 files changed

Lines changed: 3 additions & 0 deletions

File tree

front/src/app/embalse-cuenca/page.tsx

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ import { Metadata } from "next";
66
export const metadata: Metadata = {
77
title: "Embalses por cuencas",
88
};
9+
10+
export const revalidate = 300; // ISR: regenerar cada 5 minutos
911
export default async function EmbalsesCuencasPage() {
1012
const cuencasAPI = await getRiverBasins();
1113
const cuencaList = mapLookupListFromApiToViewModel(cuencasAPI);

front/src/pods/embalse-cuenca-list/embalse-cuenca-list.repository.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,5 +16,6 @@ export async function getRiverBasins(): Promise<LookupApi[]> {
1616
"Error:",
1717
error instanceof Error ? error.message : error,
1818
);
19+
return [];
1920
}
2021
}

0 commit comments

Comments
 (0)