remove teamId from status pages

This commit is contained in:
Alex Holliday
2025-06-13 13:29:03 +08:00
parent 18ea551118
commit b499b2879c
6 changed files with 5 additions and 14 deletions
+1 -1
View File
@@ -29,7 +29,7 @@ const Incidents = () => {
//Utils
const theme = useTheme();
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId();
const [monitors, , isLoading, networkError] = useFetchMonitorsByTeamId({});
useEffect(() => {
const monitorLookup = monitors?.reduce((acc, monitor) => {
@@ -13,9 +13,7 @@ const useStatusPagesFetch = () => {
useEffect(() => {
const fetchStatusPages = async () => {
try {
const res = await networkService.getStatusPagesByTeamId({
teamId: user.teamId,
});
const res = await networkService.getStatusPagesByTeamId();
setStatusPages(res?.data?.data);
} catch (error) {
setNetworkError(true);
+1 -2
View File
@@ -838,8 +838,7 @@ class NetworkService {
}
async getStatusPagesByTeamId(config) {
const { teamId } = config;
return this.axiosInstance.get(`/status-page/team/${teamId}`, {
return this.axiosInstance.get(`/status-page/team`, {
headers: {
"Content-Type": "application/json",
},
+1 -1
View File
@@ -99,7 +99,7 @@ class StatusPageController {
getStatusPagesByTeamId = async (req, res, next) => {
try {
const teamId = req.params.teamId;
const teamId = req.user.teamId;
const statusPages = await this.db.getStatusPagesByTeamId(teamId);
return res.success({
+1 -5
View File
@@ -12,11 +12,7 @@ class StatusPageRoutes {
initRoutes() {
this.router.get("/", this.statusPageController.getStatusPage);
this.router.get(
"/team/:teamId",
verifyJWT,
this.statusPageController.getStatusPagesByTeamId
);
this.router.get("/team", verifyJWT, this.statusPageController.getStatusPagesByTeamId);
this.router.get("/:url", this.statusPageController.getStatusPageByUrl);
this.router.post(
-2
View File
@@ -165,8 +165,6 @@ const getCertificateParamValidation = joi.object({
const createMonitorBodyValidation = joi.object({
_id: joi.string(),
userId: joi.string().required(),
teamId: joi.string().required(),
name: joi.string().required(),
description: joi.string().required(),
type: joi.string().required(),