Compare commits

...

5 Commits

Author SHA1 Message Date
dvelo
45fcc618c2
fix: status is broken
fix: status is broken
2025-02-06 19:16:52 -06:00
dvelo
7e7c1a8648 Merge branch 'dev' of https://github.com/DeveloLongScript/MHSF into dev 2025-02-06 18:34:01 -06:00
dvelo
17f444fbf4 fix: status is broken 2025-02-06 18:33:59 -06:00
dvelo
d8e1f96948
Merge pull request #84 from DeveloLongScript/dev
Update bug_report.md
2025-02-06 18:05:40 -06:00
dvelo
c4bd338b2e
Update bug_report.md 2025-02-06 17:36:43 -06:00
2 changed files with 26 additions and 25 deletions

@ -2,7 +2,7 @@
name: Bug report name: Bug report
about: Create a report to help us improve about: Create a report to help us improve
title: '' title: ''
labels: '' labels: 'bug'
assignees: '' assignees: ''
--- ---

@ -31,15 +31,15 @@ import { NextApiRequest, NextApiResponse } from "next";
export default async function handler( export default async function handler(
req: NextApiRequest, req: NextApiRequest,
res: NextApiResponse res: NextApiResponse,
) { ) {
const betterStackResult = await fetch( const betterStackResult = await fetch(
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}/status-reports`, `https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}/status-reports`,
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } } { headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } },
); );
const betterStackURL = await fetch( const betterStackURL = await fetch(
`https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}`, `https://uptime.betterstack.com/api/v2/status-pages/${process.env.BS_STATUS_PAGE}`,
{ headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } } { headers: { Authorization: `Bearer ${process.env.BS_TOKEN}` } },
); );
const result = await betterStackResult.json(); const result = await betterStackResult.json();
@ -50,8 +50,9 @@ export default async function handler(
c.attributes.ends_at === null && c.attributes.ends_at === null &&
c.attributes.affected_resources.filter( c.attributes.affected_resources.filter(
(v: any) => (v: any) =>
v.status_page_resource_id === process.env.BS_STATUS_MAIN_WEBSITE v.status_page_resource_id === process.env.BS_STATUS_MAIN_WEBSITE &&
).length > 0 v.status !== "resolved",
).length > 0,
); );
res.status(200).send({ res.status(200).send({