🦺 fix: validate service status before showing error page
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 54s
Some checks failed
Integration Tests / integration-tests (pull_request) Failing after 54s
This commit is contained in:
@ -1,6 +1,18 @@
|
|||||||
import StatusIndex from "@/features/status";
|
import StatusIndex from "@/features/status";
|
||||||
|
import { backendFetch } from "@/shared/helpers/backendFetch";
|
||||||
|
import { redirect } from "next/navigation";
|
||||||
|
|
||||||
|
const page = async () => {
|
||||||
|
// Check service status with API call
|
||||||
|
let isDown = false;
|
||||||
|
try {
|
||||||
|
const data = await backendFetch("status");
|
||||||
|
console.log(data);
|
||||||
|
} catch (_) {
|
||||||
|
isDown = true;
|
||||||
|
}
|
||||||
|
if (!isDown) redirect("/");
|
||||||
|
|
||||||
const page = () => {
|
|
||||||
return (
|
return (
|
||||||
<div>
|
<div>
|
||||||
<StatusIndex />
|
<StatusIndex />
|
||||||
|
|||||||
Reference in New Issue
Block a user