mirror of
https://github.com/fosrl/pangolin.git
synced 2026-03-09 04:06:36 +00:00
add to priv route
This commit is contained in:
committed by
Owen Schwartz
parent
b8ffc601d4
commit
2d92111f1d
@@ -1,7 +1,6 @@
|
|||||||
|
|
||||||
import { headers } from "next/headers";
|
import { headers } from "next/headers";
|
||||||
import { internal } from "@app/lib/api";
|
import { priv } from "@app/lib/api";
|
||||||
import { AxiosResponse } from "axios";
|
|
||||||
import { GetMaintenanceInfoResponse } from "@server/routers/resource";
|
import { GetMaintenanceInfoResponse } from "@server/routers/resource";
|
||||||
|
|
||||||
|
|
||||||
@@ -23,12 +22,13 @@ export default async function MaintenanceScreen() {
|
|||||||
const host = headersList.get("host") || "";
|
const host = headersList.get("host") || "";
|
||||||
const hostname = host.split(":")[0];
|
const hostname = host.split(":")[0];
|
||||||
|
|
||||||
const res = await internal.get<AxiosResponse<GetMaintenanceInfoResponse>>(
|
const res = await priv.get<GetMaintenanceInfoResponse>(
|
||||||
`/maintenance/info?fullDomain=${encodeURIComponent(hostname)}`
|
`/maintenance/info?fullDomain=${encodeURIComponent(hostname)}`
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
if (res && res.status === 200) {
|
if (res && res.status === 200) {
|
||||||
const maintenanceInfo = res.data.data;
|
const maintenanceInfo = res.data;
|
||||||
title = maintenanceInfo?.maintenanceTitle || title;
|
title = maintenanceInfo?.maintenanceTitle || title;
|
||||||
message = maintenanceInfo?.maintenanceMessage || message;
|
message = maintenanceInfo?.maintenanceMessage || message;
|
||||||
estimatedTime = maintenanceInfo?.maintenanceEstimatedTime || null;
|
estimatedTime = maintenanceInfo?.maintenanceEstimatedTime || null;
|
||||||
|
|||||||
Reference in New Issue
Block a user