mirror of
https://github.com/bluewave-labs/Checkmate.git
synced 2026-05-06 08:40:33 -05:00
remove teamId from status pages
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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",
|
||||
},
|
||||
|
||||
@@ -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({
|
||||
|
||||
@@ -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(
|
||||
|
||||
@@ -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(),
|
||||
|
||||
Reference in New Issue
Block a user