eventlog: branding events

This commit is contained in:
Girish Ramakrishnan
2024-12-02 12:11:14 +01:00
parent 872705d58d
commit 0a4aede3a8
6 changed files with 33 additions and 6 deletions

View File

@@ -31,7 +31,7 @@ async function setFooter(req, res, next) {
if (typeof req.body.footer !== 'string') return next(new HttpError(400, 'footer is required'));
const [error] = await safe(branding.setFooter(req.body.footer));
const [error] = await safe(branding.setFooter(req.body.footer, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));
@@ -63,7 +63,7 @@ async function setCloudronAvatar(req, res, next) {
safe.fs.unlinkSync(req.files.avatar.path);
if (!avatar) return next(500, safe.error.message);
const [error] = await safe(branding.setCloudronAvatar(avatar));
const [error] = await safe(branding.setCloudronAvatar(avatar, AuditSource.fromRequest(req)));
if (error) return next(BoxError.toHttpError(error));
next(new HttpSuccess(200, {}));