Skip to content

Commit

Permalink
fix: fix author column in audit table
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2sw committed Jul 28, 2022
1 parent ccca25f commit 2f9a441
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/tasks/sync-audit-table.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,20 +110,22 @@ const syncOrganizationAudit = async (organization) => {
// 0x636f6d6d656e74 is hex for 'comment'
const comment = kvDiff.filter(
(diff) =>
diff.key === '636f6d6d656e74' || diff.key === '0x636f6d6d656e74',
(diff.key === '636f6d6d656e74' || diff.key === '0x636f6d6d656e74') &&
diff.type === 'INSERT',
);

// 0x617574686F72 is hex for 'author'
const author = kvDiff.filter(
(diff) =>
diff.key === '617574686F72' || diff.key === '0x617574686F72',
(diff.key === '617574686f72' || diff.key === '0x617574686F72') &&
diff.type === 'INSERT',
);

await Promise.all(
kvDiff.map(async (diff) => {
const key = decodeHex(diff.key);
const modelKey = key.split('|')[0];
if (key !== 'comment') {
if (!['comment', 'author'].includes(key)) {
Audit.create({
orgUid: organization.orgUid,
registryId: organization.registryId,
Expand Down

0 comments on commit 2f9a441

Please sign in to comment.