stop loading when no audit log permissions

This commit is contained in:
sadnub
2021-11-07 12:37:36 -05:00
parent 3dc106bae1
commit 9634936ffe
2 changed files with 7 additions and 8 deletions

View File

@@ -10,10 +10,8 @@ export async function fetchDebugLog(payload) {
}
export async function fetchAuditLog(payload) {
try {
const { data } = await axios.patch(`${baseUrl}/audit/`, payload)
return data
} catch (e) { }
const { data } = await axios.patch(`${baseUrl}/audit/`, payload)
return data
}
// pending actions

View File

@@ -274,10 +274,11 @@ export default {
if (timeFilter.value) data["timeFilter"] = timeFilter.value;
if (actionFilter.value && actionFilter.value.length > 0) data["actionFilter"] = actionFilter.value;
if (objectFilter.value && objectFilter.value.length > 0) data["objectFilter"] = objectFilter.value;
const { audit_logs, total } = await fetchAuditLog(data);
auditLogs.value = audit_logs;
pagination.value.rowsNumber = total;
try {
const { audit_logs, total } = await fetchAuditLog(data);
auditLogs.value = audit_logs;
pagination.value.rowsNumber = total;
} catch (e) {}
loading.value = false;
}