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