summaryrefslogtreecommitdiffstats
path: root/webapp/utils/async_client.jsx
diff options
context:
space:
mode:
Diffstat (limited to 'webapp/utils/async_client.jsx')
-rw-r--r--webapp/utils/async_client.jsx26
1 files changed, 26 insertions, 0 deletions
diff --git a/webapp/utils/async_client.jsx b/webapp/utils/async_client.jsx
index 9a5869f9a..2392b50b9 100644
--- a/webapp/utils/async_client.jsx
+++ b/webapp/utils/async_client.jsx
@@ -342,6 +342,32 @@ export function getServerAudits() {
);
}
+export function getComplianceReports() {
+ if (isCallInProgress('getComplianceReports')) {
+ return;
+ }
+
+ callTracker.getComplianceReports = utils.getTimestamp();
+ client.getComplianceReports(
+ (data, textStatus, xhr) => {
+ callTracker.getComplianceReports = 0;
+
+ if (xhr.status === 304 || !data) {
+ return;
+ }
+
+ AppDispatcher.handleServerAction({
+ type: ActionTypes.RECEIVED_SERVER_COMPLIANCE_REPORTS,
+ complianceReports: data
+ });
+ },
+ (err) => {
+ callTracker.getComplianceReports = 0;
+ dispatchError(err, 'getComplianceReports');
+ }
+ );
+}
+
export function getConfig() {
if (isCallInProgress('getConfig')) {
return;