mirror of
https://github.com/valitydev/wazuh-kibana-app.git
synced 2024-11-07 02:15:24 +00:00
Refreshing the scope even if the request failed
This commit is contained in:
parent
1923ea63b6
commit
999a78353c
@ -29,7 +29,7 @@ export async function searchData(
|
||||
} catch (error) {
|
||||
$scope.wazuh_table_loading = false;
|
||||
$scope.error = `Error searching - ${error.message ||
|
||||
error} - Please refresh your browser.`;
|
||||
error}.`;
|
||||
errorHandler.handle(
|
||||
`Error searching. ${error.message || error}`,
|
||||
'Data factory'
|
||||
@ -65,7 +65,7 @@ export async function filterData(
|
||||
$scope.wazuh_table_loading = false;
|
||||
$scope.error = `Error filtering by ${
|
||||
filter ? filter.value : 'undefined'
|
||||
} - ${error.message || error} - Please refresh your browser.`;
|
||||
} - ${error.message || error}.`;
|
||||
errorHandler.handle(
|
||||
`Error filtering by ${
|
||||
filter ? filter.value : 'undefined'
|
||||
|
@ -50,15 +50,15 @@ export async function initTable(
|
||||
await fetch();
|
||||
wzTableFilter.set(instance.filters);
|
||||
$scope.wazuh_table_loading = false;
|
||||
if (!$scope.$$phase) $scope.$digest();
|
||||
} catch (error) {
|
||||
$scope.wazuh_table_loading = false;
|
||||
$scope.error = `Error while init table - ${error.message ||
|
||||
error} - Please refresh your browser.`;
|
||||
error}.`;
|
||||
errorHandler.handle(
|
||||
`Error while init table. ${error.message || error}`,
|
||||
'Data factory'
|
||||
);
|
||||
}
|
||||
if (!$scope.$$phase) $scope.$digest();
|
||||
return;
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ export async function nextPage(currentPage, $scope, errorHandler, fetch) {
|
||||
} catch (error) {
|
||||
$scope.wazuh_table_loading = false;
|
||||
$scope.error = `Error paginating table - ${error.message ||
|
||||
error} - Please refresh your browser.`;
|
||||
error}.`;
|
||||
errorHandler.handle(
|
||||
`Error paginating table due to ${error.message || error}`,
|
||||
'Data factory'
|
||||
|
@ -19,12 +19,11 @@ export async function sort(field, $scope, instance, fetch, errorHandler) {
|
||||
$scope.sortDir = instance.sortDir;
|
||||
await fetch();
|
||||
$scope.wazuh_table_loading = false;
|
||||
if (!$scope.$$phase) $scope.$digest();
|
||||
} catch (error) {
|
||||
$scope.wazuh_table_loading = false;
|
||||
$scope.error = `Error sorting table by ${
|
||||
field ? field.value : 'undefined'
|
||||
} - ${error.message || error} - Please refresh your browser.`;
|
||||
} - ${error.message || error}.`;
|
||||
errorHandler.handle(
|
||||
`Error sorting table by ${
|
||||
field ? field.value : 'undefined'
|
||||
@ -32,5 +31,6 @@ export async function sort(field, $scope, instance, fetch, errorHandler) {
|
||||
'Data factory'
|
||||
);
|
||||
}
|
||||
if (!$scope.$$phase) $scope.$digest();
|
||||
return;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user