fix function duplicated and log

This commit is contained in:
karenvicent committed 2026-01-22 10:58:47 -05:00
1 parent b8a5af9c10
commit 4766594413
2 files changed
+9 -24

No files matched your search

@@ -71,22 +71,11 @@ const useFetchIncidents = () => {
}, },
[fetchIncidentsByTeam] [fetchIncidentsByTeam]
); );
const fetchManualResolvedIncidents = useCallback(
async (config = {}) => { const fetchIncidentsByResolutionType = useCallback(
async (resolutionType, config = {}) => {
await fetchIncidentsByTeam({ await fetchIncidentsByTeam({
status: false, resolutionType,
resolutionType: "manual",
sortOrder: "desc",
...config,
});
},
[fetchIncidentsByTeam]
);
const fetchAutomaticResolvedIncidents = useCallback(
async (config = {}) => {
await fetchIncidentsByTeam({
status: false,
resolutionType: "automatic",
sortOrder: "desc", sortOrder: "desc",
...config, ...config,
}); });
@@ -175,7 +164,6 @@ const useFetchIncidents = () => {
createToast({ body: t("incidentsPage.errorResolvingIncident") }); createToast({ body: t("incidentsPage.errorResolvingIncident") });
} }
} catch (error) { } catch (error) {
console.log("cayo a error");
setNetworkError(true); setNetworkError(true);
console.error(t("incidentsPage.errorResolvingIncident"), error); console.error(t("incidentsPage.errorResolvingIncident"), error);
const errorMessage = const errorMessage =
@@ -220,8 +208,7 @@ const useFetchIncidents = () => {
fetchIncidentById, fetchIncidentById,
resolveIncident, resolveIncident,
fetchIncidentSummary, fetchIncidentSummary,
fetchManualResolvedIncidents, fetchIncidentsByResolutionType,
fetchAutomaticResolvedIncidents,
}; };
}; };
+4 -6
View File
@@ -49,8 +49,7 @@ const Incidents2 = () => {
fetchActiveIncidents, fetchActiveIncidents,
fetchResolvedIncidents, fetchResolvedIncidents,
resolveIncident, resolveIncident,
fetchManualResolvedIncidents, fetchIncidentsByResolutionType,
fetchAutomaticResolvedIncidents,
} = useFetchIncidents(); } = useFetchIncidents();
const networkError = monitorsNetworkError || incidentsNetworkError; const networkError = monitorsNetworkError || incidentsNetworkError;
@@ -75,9 +74,9 @@ const Incidents2 = () => {
} else if (filter === "resolved") { } else if (filter === "resolved") {
fetchResolvedIncidents(config); fetchResolvedIncidents(config);
} else if (filter === "manual") { } else if (filter === "manual") {
fetchManualResolvedIncidents(config); fetchIncidentsByResolutionType("manual", config);
} else if (filter === "automatic") { } else if (filter === "automatic") {
fetchAutomaticResolvedIncidents(config); fetchIncidentsByResolutionType("automatic", config);
} else { } else {
fetchIncidents(config); fetchIncidents(config);
} }
@@ -91,8 +90,7 @@ const Incidents2 = () => {
fetchActiveIncidents, fetchActiveIncidents,
fetchResolvedIncidents, fetchResolvedIncidents,
fetchIncidents, fetchIncidents,
fetchManualResolvedIncidents, fetchIncidentsByResolutionType,
fetchAutomaticResolvedIncidents,
]); ]);
useEffect(() => { useEffect(() => {