Add per-app notes feature
This commit is contained in:
@@ -23,6 +23,7 @@ exports = module.exports = {
|
||||
setCrontab,
|
||||
setLabel,
|
||||
setTags,
|
||||
setNotes,
|
||||
setIcon,
|
||||
setTurn,
|
||||
setRedis,
|
||||
@@ -257,6 +258,18 @@ async function setTags(req, res, next) {
|
||||
next(new HttpSuccess(200, {}));
|
||||
}
|
||||
|
||||
async function setNotes(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
if (typeof req.body.notes !== 'string') return next(new HttpError(400, 'notes must be a string'));
|
||||
|
||||
const [error] = await safe(apps.setNotes(req.app, req.body.notes, AuditSource.fromRequest(req)));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
}
|
||||
|
||||
async function setIcon(req, res, next) {
|
||||
assert.strictEqual(typeof req.body, 'object');
|
||||
assert.strictEqual(typeof req.app, 'object');
|
||||
|
||||
Reference in New Issue
Block a user