Browse Source

refactor(nc-gui): remove audit calls from frontend side

pull/5403/head
Wing-Kam Wong 2 years ago
parent
commit
d85e01f336
  1. 19
      packages/nc-gui/composables/useExpandedFormStore.ts
  2. 9
      packages/nc-gui/composables/useKanbanViewStore.ts
  3. 9
      packages/nc-gui/composables/useViewData.ts

19
packages/nc-gui/composables/useExpandedFormStore.ts

@ -7,7 +7,6 @@ import {
computed,
extractPkFromRow,
extractSdkResponseErrorMsg,
getHTMLEncodedText,
message,
populateInsertObject,
ref,
@ -253,22 +252,8 @@ const [useProvideExpandedFormStore, useExpandedFormStore] = useInjectionState((m
})
}
for (const key of Object.keys(updateOrInsertObj)) {
// audit
$api.utils
.auditRowUpdate(id, {
fk_model_id: meta.value.id,
column_name: key,
row_id: id,
value: getHTMLEncodedText(updateOrInsertObj[key]),
prev_value: getHTMLEncodedText(row.value.oldRow[key]),
})
.then(async () => {
/** load latest comments/audit if right drawer is open */
if (commentsDrawer.value) {
await loadCommentsAndLogs()
}
})
if (commentsDrawer.value) {
await loadCommentsAndLogs()
}
} else {
// No columns to update

9
packages/nc-gui/composables/useKanbanViewStore.ts

@ -8,7 +8,6 @@ import {
enumColor,
extractPkFromRow,
extractSdkResponseErrorMsg,
getHTMLEncodedText,
inject,
message,
parseProp,
@ -401,14 +400,6 @@ const [useProvideKanbanViewStore, useKanbanViewStore] = useInjectionState(
// query: { ignoreWebhook: !saved }
// }
)
// audit
$api.utils.auditRowUpdate(id, {
fk_model_id: meta.value?.id as string,
column_name: property,
row_id: id,
value: getHTMLEncodedText(toUpdate.row[property]),
prev_value: getHTMLEncodedText(toUpdate.oldRow[property]),
})
if (!undo) {
const oldRowIndex = moveHistory.value.find((ele) => ele.op === 'removed' && ele.pk === id)

9
packages/nc-gui/composables/useViewData.ts

@ -8,7 +8,6 @@ import {
computed,
extractPkFromRow,
extractSdkResponseErrorMsg,
getHTMLEncodedText,
message,
populateInsertObject,
ref,
@ -350,14 +349,6 @@ export function useViewData(
// query: { ignoreWebhook: !saved }
// }
)
// audit
$api.utils.auditRowUpdate(encodeURIComponent(id), {
fk_model_id: metaValue?.id as string,
column_name: property,
row_id: id,
value: getHTMLEncodedText(toUpdate.row[property]),
prev_value: getHTMLEncodedText(toUpdate.oldRow[property]),
})
if (!undo) {
addUndo({

Loading…
Cancel
Save