remove authToken passing in redux thunks
This commit is contained in:
1 parent
9e0532baf1
commit
6a1e5532e4
5 files changed
+45
-122
No files matched your search
@@ -44,7 +44,7 @@ export const login = createAsyncThunk("auth/login", async (form, thunkApi) => {
|
|||||||
});
|
});
|
||||||
|
|
||||||
export const update = createAsyncThunk("auth/update", async (data, thunkApi) => {
|
export const update = createAsyncThunk("auth/update", async (data, thunkApi) => {
|
||||||
const { authToken: token, localData: form } = data;
|
const { localData: form } = data;
|
||||||
const user = jwtDecode(token);
|
const user = jwtDecode(token);
|
||||||
try {
|
try {
|
||||||
const fd = new FormData();
|
const fd = new FormData();
|
||||||
@@ -61,7 +61,6 @@ export const update = createAsyncThunk("auth/update", async (data, thunkApi) =>
|
|||||||
form.deleteProfileImage && fd.append("deleteProfileImage", form.deleteProfileImage);
|
form.deleteProfileImage && fd.append("deleteProfileImage", form.deleteProfileImage);
|
||||||
|
|
||||||
const res = await networkService.updateUser({
|
const res = await networkService.updateUser({
|
||||||
authToken: token,
|
|
||||||
userId: user._id,
|
userId: user._id,
|
||||||
form: fd,
|
form: fd,
|
||||||
});
|
});
|
||||||
@@ -82,10 +81,7 @@ export const deleteUser = createAsyncThunk("auth/delete", async (data, thunkApi)
|
|||||||
const user = jwtDecode(data);
|
const user = jwtDecode(data);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
const res = await networkService.deleteUser({
|
const res = await networkService.deleteUser({ userId: user._id, });
|
||||||
authToken: data,
|
|
||||||
userId: user._id,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
|
|||||||
@@ -12,11 +12,8 @@ export const createInfrastructureMonitor = createAsyncThunk(
|
|||||||
"infrastructureMonitors/createMonitor",
|
"infrastructureMonitors/createMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.createMonitor({
|
const res = await networkService.createMonitor({ monitor: monitor });
|
||||||
authToken: authToken,
|
|
||||||
monitor: monitor,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -35,12 +32,8 @@ export const checkInfrastructureEndpointResolution = createAsyncThunk(
|
|||||||
"infrastructureMonitors/CheckEndpoint",
|
"infrastructureMonitors/CheckEndpoint",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorURL } = data;
|
const { monitorURL } = data;
|
||||||
|
const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, });
|
||||||
const res = await networkService.checkEndpointResolution({
|
|
||||||
authToken: authToken,
|
|
||||||
monitorURL: monitorURL,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -59,11 +52,8 @@ export const getInfrastructureMonitorById = createAsyncThunk(
|
|||||||
"infrastructureMonitors/getMonitorById",
|
"infrastructureMonitors/getMonitorById",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.getMonitorById({
|
const res = await networkService.getMonitorById({ monitorId: monitorId });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -84,7 +74,6 @@ export const getInfrastructureMonitorsByTeamId = createAsyncThunk(
|
|||||||
const user = jwtDecode(token);
|
const user = jwtDecode(token);
|
||||||
try {
|
try {
|
||||||
const res = await networkService.getMonitorsAndSummaryByTeamId({
|
const res = await networkService.getMonitorsAndSummaryByTeamId({
|
||||||
authToken: token,
|
|
||||||
teamId: user.teamId,
|
teamId: user.teamId,
|
||||||
types: ["hardware"],
|
types: ["hardware"],
|
||||||
limit: 1,
|
limit: 1,
|
||||||
@@ -108,7 +97,7 @@ export const updateInfrastructureMonitor = createAsyncThunk(
|
|||||||
"infrastructureMonitors/updateMonitor",
|
"infrastructureMonitors/updateMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const updatedFields = {
|
const updatedFields = {
|
||||||
name: monitor.name,
|
name: monitor.name,
|
||||||
description: monitor.description,
|
description: monitor.description,
|
||||||
@@ -117,7 +106,6 @@ export const updateInfrastructureMonitor = createAsyncThunk(
|
|||||||
threshold: monitor.threshold,
|
threshold: monitor.threshold,
|
||||||
};
|
};
|
||||||
const res = await networkService.updateMonitor({
|
const res = await networkService.updateMonitor({
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
monitorId: monitor._id,
|
||||||
updatedFields: updatedFields,
|
updatedFields: updatedFields,
|
||||||
});
|
});
|
||||||
@@ -139,11 +127,8 @@ export const deleteInfrastructureMonitor = createAsyncThunk(
|
|||||||
"infrastructureMonitors/deleteMonitor",
|
"infrastructureMonitors/deleteMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.deleteMonitorById({
|
const res = await networkService.deleteMonitorById({ monitorId: monitor._id, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -162,11 +147,8 @@ export const pauseInfrastructureMonitor = createAsyncThunk(
|
|||||||
"infrastructureMonitors/pauseMonitor",
|
"infrastructureMonitors/pauseMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.pauseMonitorById({
|
const res = await networkService.pauseMonitorById({ monitorId: monitorId, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -185,11 +167,8 @@ export const deleteInfrastructureMonitorChecksByTeamId = createAsyncThunk(
|
|||||||
"infrastructureMonitors/deleteChecksByTeamId",
|
"infrastructureMonitors/deleteChecksByTeamId",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, teamId } = data;
|
const { teamId } = data;
|
||||||
const res = await networkService.deleteChecksByTeamId({
|
const res = await networkService.deleteChecksByTeamId({ teamId: teamId, });
|
||||||
authToken: authToken,
|
|
||||||
teamId: teamId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -208,10 +187,7 @@ export const deleteAllInfrastructureMonitors = createAsyncThunk(
|
|||||||
"infrastructureMonitors/deleteAllMonitors",
|
"infrastructureMonitors/deleteAllMonitors",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken } = data;
|
const res = await networkService.deleteAllMonitors();
|
||||||
const res = await networkService.deleteAllMonitors({
|
|
||||||
authToken: authToken,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
|
|||||||
@@ -12,11 +12,8 @@ export const createPageSpeed = createAsyncThunk(
|
|||||||
"pageSpeedMonitors/createPageSpeed",
|
"pageSpeedMonitors/createPageSpeed",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.createMonitor({
|
const res = await networkService.createMonitor({ monitor: monitor, });
|
||||||
authToken: authToken,
|
|
||||||
monitor: monitor,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -35,12 +32,8 @@ export const checkEndpointResolution = createAsyncThunk(
|
|||||||
"monitors/checkEndpoint",
|
"monitors/checkEndpoint",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorURL } = data;
|
const { monitorURL } = data;
|
||||||
|
const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, });
|
||||||
const res = await networkService.checkEndpointResolution({
|
|
||||||
authToken: authToken,
|
|
||||||
monitorURL: monitorURL,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -59,11 +52,8 @@ export const getPagespeedMonitorById = createAsyncThunk(
|
|||||||
"monitors/getMonitorById",
|
"monitors/getMonitorById",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.getMonitorById({
|
const res = await networkService.getMonitorById({ monitorId: monitorId, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -84,7 +74,6 @@ export const getPageSpeedByTeamId = createAsyncThunk(
|
|||||||
const user = jwtDecode(token);
|
const user = jwtDecode(token);
|
||||||
try {
|
try {
|
||||||
const res = await networkService.getMonitorsAndSummaryByTeamId({
|
const res = await networkService.getMonitorsAndSummaryByTeamId({
|
||||||
authToken: token,
|
|
||||||
teamId: user.teamId,
|
teamId: user.teamId,
|
||||||
types: ["pagespeed"],
|
types: ["pagespeed"],
|
||||||
});
|
});
|
||||||
@@ -106,7 +95,7 @@ export const updatePageSpeed = createAsyncThunk(
|
|||||||
"pageSpeedMonitors/updatePageSpeed",
|
"pageSpeedMonitors/updatePageSpeed",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const updatedFields = {
|
const updatedFields = {
|
||||||
name: monitor.name,
|
name: monitor.name,
|
||||||
description: monitor.description,
|
description: monitor.description,
|
||||||
@@ -114,7 +103,6 @@ export const updatePageSpeed = createAsyncThunk(
|
|||||||
// notifications: monitor.notifications,
|
// notifications: monitor.notifications,
|
||||||
};
|
};
|
||||||
const res = await networkService.updateMonitor({
|
const res = await networkService.updateMonitor({
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
monitorId: monitor._id,
|
||||||
updatedFields: updatedFields,
|
updatedFields: updatedFields,
|
||||||
});
|
});
|
||||||
@@ -136,11 +124,8 @@ export const deletePageSpeed = createAsyncThunk(
|
|||||||
"pageSpeedMonitors/deletePageSpeed",
|
"pageSpeedMonitors/deletePageSpeed",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.deleteMonitorById({
|
const res = await networkService.deleteMonitorById({ monitorId: monitor._id, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -158,11 +143,8 @@ export const pausePageSpeed = createAsyncThunk(
|
|||||||
"pageSpeedMonitors/pausePageSpeed",
|
"pageSpeedMonitors/pausePageSpeed",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.pauseMonitorById({
|
const res = await networkService.pauseMonitorById({ monitorId: monitorId, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
|
|||||||
@@ -11,9 +11,7 @@ export const getAppSettings = createAsyncThunk(
|
|||||||
"settings/getSettings",
|
"settings/getSettings",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const res = await networkService.getAppSettings({
|
const res = await networkService.getAppSettings();
|
||||||
authToken: data.authToken,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response.data) {
|
if (error.response.data) {
|
||||||
@@ -30,7 +28,7 @@ export const getAppSettings = createAsyncThunk(
|
|||||||
|
|
||||||
export const updateAppSettings = createAsyncThunk(
|
export const updateAppSettings = createAsyncThunk(
|
||||||
"settings/updateSettings",
|
"settings/updateSettings",
|
||||||
async ({ settings, authToken }, thunkApi) => {
|
async ({ settings }, thunkApi) => {
|
||||||
networkService.setBaseUrl(settings.apiBaseUrl);
|
networkService.setBaseUrl(settings.apiBaseUrl);
|
||||||
try {
|
try {
|
||||||
const parsedSettings = {
|
const parsedSettings = {
|
||||||
@@ -49,10 +47,7 @@ export const updateAppSettings = createAsyncThunk(
|
|||||||
systemEmailAddress: settings.systemEmailAddress,
|
systemEmailAddress: settings.systemEmailAddress,
|
||||||
systemEmailPassword: settings.systemEmailPassword,
|
systemEmailPassword: settings.systemEmailPassword,
|
||||||
};
|
};
|
||||||
const res = await networkService.updateAppSettings({
|
const res = await networkService.updateAppSettings({ settings: parsedSettings, });
|
||||||
settings: parsedSettings,
|
|
||||||
authToken,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
|
|||||||
@@ -12,11 +12,8 @@ export const createUptimeMonitor = createAsyncThunk(
|
|||||||
"monitors/createMonitor",
|
"monitors/createMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.createMonitor({
|
const res = await networkService.createMonitor({ monitor: monitor });
|
||||||
authToken: authToken,
|
|
||||||
monitor: monitor,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -35,12 +32,8 @@ export const checkEndpointResolution = createAsyncThunk(
|
|||||||
"monitors/checkEndpoint",
|
"monitors/checkEndpoint",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorURL } = data;
|
const { monitorURL } = data;
|
||||||
|
const res = await networkService.checkEndpointResolution({ monitorURL: monitorURL, });
|
||||||
const res = await networkService.checkEndpointResolution({
|
|
||||||
authToken: authToken,
|
|
||||||
monitorURL: monitorURL,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -59,11 +52,8 @@ export const getUptimeMonitorById = createAsyncThunk(
|
|||||||
"monitors/getMonitorById",
|
"monitors/getMonitorById",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.getMonitorById({
|
const res = await networkService.getMonitorById({ monitorId: monitorId, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -82,7 +72,7 @@ export const updateUptimeMonitor = createAsyncThunk(
|
|||||||
"monitors/updateMonitor",
|
"monitors/updateMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const updatedFields = {
|
const updatedFields = {
|
||||||
name: monitor.name,
|
name: monitor.name,
|
||||||
description: monitor.description,
|
description: monitor.description,
|
||||||
@@ -93,7 +83,6 @@ export const updateUptimeMonitor = createAsyncThunk(
|
|||||||
jsonPath: monitor.jsonPath,
|
jsonPath: monitor.jsonPath,
|
||||||
};
|
};
|
||||||
const res = await networkService.updateMonitor({
|
const res = await networkService.updateMonitor({
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
monitorId: monitor._id,
|
||||||
monitor,
|
monitor,
|
||||||
});
|
});
|
||||||
@@ -115,11 +104,8 @@ export const deleteUptimeMonitor = createAsyncThunk(
|
|||||||
"monitors/deleteMonitor",
|
"monitors/deleteMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitor } = data;
|
const { monitor } = data;
|
||||||
const res = await networkService.deleteMonitorById({
|
const res = await networkService.deleteMonitorById({ monitorId: monitor._id, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitor._id,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -138,11 +124,8 @@ export const pauseUptimeMonitor = createAsyncThunk(
|
|||||||
"monitors/pauseMonitor",
|
"monitors/pauseMonitor",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, monitorId } = data;
|
const { monitorId } = data;
|
||||||
const res = await networkService.pauseMonitorById({
|
const res = await networkService.pauseMonitorById({ monitorId: monitorId, });
|
||||||
authToken: authToken,
|
|
||||||
monitorId: monitorId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -161,11 +144,8 @@ export const deleteMonitorChecksByTeamId = createAsyncThunk(
|
|||||||
"monitors/deleteChecksByTeamId",
|
"monitors/deleteChecksByTeamId",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken, teamId } = data;
|
const { teamId } = data;
|
||||||
const res = await networkService.deleteChecksByTeamId({
|
const res = await networkService.deleteChecksByTeamId({ teamId: teamId, });
|
||||||
authToken: authToken,
|
|
||||||
teamId: teamId,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -183,10 +163,7 @@ export const addDemoMonitors = createAsyncThunk(
|
|||||||
"monitors/addDemoMonitors",
|
"monitors/addDemoMonitors",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken } = data;
|
const res = await networkService.addDemoMonitors();
|
||||||
const res = await networkService.addDemoMonitors({
|
|
||||||
authToken: authToken,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
@@ -205,10 +182,7 @@ export const deleteAllMonitors = createAsyncThunk(
|
|||||||
"monitors/deleteAllMonitors",
|
"monitors/deleteAllMonitors",
|
||||||
async (data, thunkApi) => {
|
async (data, thunkApi) => {
|
||||||
try {
|
try {
|
||||||
const { authToken } = data;
|
const res = await networkService.deleteAllMonitors();
|
||||||
const res = await networkService.deleteAllMonitors({
|
|
||||||
authToken: authToken,
|
|
||||||
});
|
|
||||||
return res.data;
|
return res.data;
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
if (error.response && error.response.data) {
|
if (error.response && error.response.data) {
|
||||||
|
|||||||
Reference in new issue
Block a user