Spaces:
Running
Running
feat: implement core backend POS API with authentication, role-based access control, menu management, and order processing logic.
1e480b5 Download src/utils/activityLogger.js from aliroohan179/face: direct link, hf CLI and curl.
- Browser
- Download file 497 Bytes
-
https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/utils/activityLogger.js
- Command line
-
hf download hf://spaces/aliroohan179/face/src/utils/activityLogger.js
-
curl -L -o activityLogger.js https://huggingface.co/spaces/aliroohan179/face/resolve/main/src/utils/activityLogger.js
497 Bytes
| const ActivityLog = require('../models/ActivityLog'); | |
| /** | |
| * Fire-and-forget activity logger. | |
| * Does NOT await — never blocks the request. | |
| */ | |
| const log = (user, action, options = {}) => { | |
| const { entity = null, entityId = null, detail = '', ip = '' } = options; | |
| ActivityLog.create({ | |
| user: user._id, | |
| userName: user.name, | |
| action, | |
| entity, | |
| entityId, | |
| detail, | |
| ip, | |
| }).catch((err) => console.error('Activity log error:', err.message)); | |
| }; | |
| module.exports = { log }; | |