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