Skip to content

Conversation

@Pikalot
Copy link
Collaborator

@Pikalot Pikalot commented Aug 1, 2025

This PR is in sync with PR # https://github.com/pxtrickhoxng/Clark/commits/audit-on-print/

Screenshot:
image

@Pikalot Pikalot force-pushed the devTA_audit_on_print branch 5 times, most recently from 54b0782 to 330defb Compare August 3, 2025 07:19
const { totalChunks, chunkIdx } = req.body;
const details = {
copies: parseInt(copies),
sides: sides,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
sides: sides,
sides,

when key = value we only need to write it once

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

router.post('/sendPrintRequest', upload.single('chunk'), async (req, res) => {
let totalFileSize = 0;
const { copies, sides, id } = req.body;
const action = AuditLogActions.PRINT_PAGE;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's just remove this and specify what the AuditLog action is when we create the AuditLog

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done!

Comment on lines 105 to 92
if (!PRINTING.ENABLED) {
details.status = 'mocked';
// create audit log on print
await createAuditLog({
user,
action,
details
});
logger.warn('Printing is disabled, returning 200 to mock the printing server');
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is this creating an audit log when we're running Clark on local? if so, i don't think we need this, we can find a way to write unit tests around this specific case

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! This block is removed.

} else {
return {
status: SERVER_ERROR,
error: 'Failed to create audit log in cleezyHelpers'
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

are we only using this for cleezy? if not then we should change this line

Copy link
Collaborator Author

@Pikalot Pikalot Aug 4, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice catch! My poor copy and paste mistakes!
Done! Removed the helper for now and waiting for the Audit team's idea!

}

};
module.exports = { createAuditLog };
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if we are creating a helper function to create Audit logs, we need to notify the Audit Log team so that this can be used everywhere Audit Logs are being created across Clark

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done! Removed the helper for now and waiting for the Audit team's idea!

@Pikalot Pikalot force-pushed the devTA_audit_on_print branch 3 times, most recently from 7046dc5 to 8bb4568 Compare August 4, 2025 06:39
@Pikalot Pikalot force-pushed the devTA_audit_on_print branch from 8bb4568 to d539165 Compare August 4, 2025 06:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants