Conversation
54b0782 to
330defb
Compare
api/main_endpoints/routes/Printer.js
Outdated
| const { totalChunks, chunkIdx } = req.body; | ||
| const details = { | ||
| copies: parseInt(copies), | ||
| sides: sides, |
There was a problem hiding this comment.
| sides: sides, | |
| sides, |
when key = value we only need to write it once
api/main_endpoints/routes/Printer.js
Outdated
| router.post('/sendPrintRequest', upload.single('chunk'), async (req, res) => { | ||
| let totalFileSize = 0; | ||
| const { copies, sides, id } = req.body; | ||
| const action = AuditLogActions.PRINT_PAGE; |
There was a problem hiding this comment.
let's just remove this and specify what the AuditLog action is when we create the AuditLog
| 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'); |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Done! This block is removed.
| } else { | ||
| return { | ||
| status: SERVER_ERROR, | ||
| error: 'Failed to create audit log in cleezyHelpers' |
There was a problem hiding this comment.
are we only using this for cleezy? if not then we should change this line
There was a problem hiding this comment.
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 }; |
There was a problem hiding this comment.
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
There was a problem hiding this comment.
Done! Removed the helper for now and waiting for the Audit team's idea!
7046dc5 to
8bb4568
Compare
…Clean up all test data after completing User.js and ShortcutSearch.js tests.
Co-authored-by: adarsh <110150037+adarshm11@users.noreply.github.com>
…g and skip the test if config/json.PRINTING is false.
8bb4568 to
d539165
Compare
This PR is in sync with PR # https://github.com/pxtrickhoxng/Clark/commits/audit-on-print/
Screenshot:
