applinks icon improvements
This commit is contained in:
@@ -22,6 +22,9 @@ async function listByUser(req, res, next) {
|
||||
const [error, result] = await safe(applinks.listByUser(req.user));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
// we have a separate route for this
|
||||
result.forEach(function (a) { delete a.icon; });
|
||||
|
||||
next(new HttpSuccess(200, { applinks: result }));
|
||||
}
|
||||
|
||||
@@ -45,6 +48,9 @@ async function get(req, res, next) {
|
||||
const [error, result] = await safe(applinks.get(req.params.id));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
// we have a separate route for this
|
||||
delete result.icon;
|
||||
|
||||
next(new HttpSuccess(200, result));
|
||||
}
|
||||
|
||||
@@ -56,6 +62,7 @@ async function update(req, res, next) {
|
||||
if ('label' in req.body && typeof req.body.label !== 'string') return next(new HttpError(400, 'label must be a string'));
|
||||
if ('tags' in req.body && !Array.isArray(req.body.tags)) return next(new HttpError(400, 'tags must be an array with strings'));
|
||||
if ('accessRestriction' in req.body && typeof req.body.accessRestriction !== 'object') return next(new HttpError(400, 'accessRestriction must be an object'));
|
||||
if ('icon' in req.body && typeof req.body.icon !== 'string') return next(new HttpError(400, 'icon must be a string'));
|
||||
|
||||
const [error] = await safe(applinks.update(req.params.id, req.body));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
Reference in New Issue
Block a user