Refactor getMonitorByUserID to getMonitorByTeamID
This commit is contained in:
1 parent
e658b4759a
commit
465c1f9f9e
7 files changed
+26
-26
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,
|
||||
|
||||
@@ -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