Skip to content

Commit

Permalink
fix comments
Browse files Browse the repository at this point in the history
  • Loading branch information
Dmytro-Melnyshyn committed Nov 7, 2023
1 parent f7adc7c commit c1a1499
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions lib/Notes/utils/getMetadataFormResponse.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,14 @@ const getMetadataPropsFromResponse = (responseMetadata) => {
createdByUsername: createdBy,
updatedByUsername,
updatedDate: lastUpdatedDate,
updatedByUserId,
createdByUserId,
} = responseMetadata;

const lastUpdatedBy = createdByUserId === updatedByUserId
? createdBy
: updatedByUsername;

const metadataProps = {};

if (createdDate) { metadataProps.createdDate = createdDate; }
if (createdBy) { metadataProps.createdBy = createdBy; }
if (lastUpdatedDate) { metadataProps.lastUpdatedDate = lastUpdatedDate; }
if (lastUpdatedBy) { metadataProps.lastUpdatedBy = lastUpdatedBy; }
if (updatedByUsername) { metadataProps.lastUpdatedBy = updatedByUsername; }

return metadataProps;
};
Expand Down

0 comments on commit c1a1499

Please sign in to comment.