Better applink icon support
This commit is contained in:
@@ -5,7 +5,8 @@ exports = module.exports = {
|
||||
add,
|
||||
get,
|
||||
update,
|
||||
remove
|
||||
remove,
|
||||
getIcon
|
||||
};
|
||||
|
||||
const assert = require('assert'),
|
||||
@@ -64,3 +65,12 @@ async function remove(req, res, next) {
|
||||
|
||||
next(new HttpSuccess(204));
|
||||
}
|
||||
|
||||
async function getIcon(req, res, next) {
|
||||
assert.strictEqual(typeof req.params.id, 'string');
|
||||
|
||||
const [error, icon] = await safe(applinks.getIcon(req.params.id, { original: req.query.original }));
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
res.send(icon);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user