Merge pull request #731 from bluewave-labs/feat/monitor-team
Feat/monitor team, resolves #725
This commit is contained in:
9 files changed
+37
-27
No files matched your search
@@ -33,9 +33,9 @@ export const getUptimeMonitorsByUserId = createAsyncThunk(
|
||||
async (token, thunkApi) => {
|
||||
const user = jwtDecode(token);
|
||||
try {
|
||||
const res = await networkService.getMonitorsByUserId(
|
||||
const res = await networkService.getMonitorsByTeamId(
|
||||
token,
|
||||
user._id,
|
||||
user.teamId,
|
||||
25,
|
||||
["http", "ping"],
|
||||
null,
|
||||
|
||||
@@ -118,9 +118,11 @@ const CreateMonitor = () => {
|
||||
form = {
|
||||
...form,
|
||||
description: form.name,
|
||||
teamId: user.teamId,
|
||||
userId: user._id,
|
||||
notifications: monitor.notifications,
|
||||
};
|
||||
console.log(form);
|
||||
const action = await dispatch(
|
||||
createUptimeMonitor({ authToken, monitor: form })
|
||||
);
|
||||
|
||||
@@ -52,9 +52,9 @@ class NetworkService {
|
||||
* @param {boolean} [normalize] - Whether to normalize the retrieved monitors.
|
||||
* @returns {Promise<AxiosResponse>} The response from the axios GET request.
|
||||
*/
|
||||
async getMonitorsByUserId(
|
||||
async getMonitorsByTeamId(
|
||||
authToken,
|
||||
userId,
|
||||
teamId,
|
||||
limit,
|
||||
types,
|
||||
status,
|
||||
@@ -74,7 +74,7 @@ class NetworkService {
|
||||
if (normalize) params.append("normalize", normalize);
|
||||
|
||||
return this.axiosInstance.get(
|
||||
`/monitors/user/${userId}?${params.toString()}`,
|
||||
`/monitors/team/${teamId}?${params.toString()}`,
|
||||
{
|
||||
headers: {
|
||||
Authorization: `Bearer ${authToken}`,
|
||||
|
||||
Reference in new issue
Block a user