applinks icon improvements
This commit is contained in:
@@ -17,6 +17,7 @@ const assert = require('assert'),
|
||||
uuid = require('uuid'),
|
||||
safe = require('safetydance'),
|
||||
superagent = require('superagent'),
|
||||
validator = require('validator'),
|
||||
jsdom = require('jsdom'),
|
||||
debug = require('debug')('box:applinks');
|
||||
|
||||
@@ -129,6 +130,13 @@ async function update(applinkId, applink) {
|
||||
|
||||
debug(`update: ${applinkId} ${applink.upstreamUri}`, applink);
|
||||
|
||||
if ('icon' in applink) {
|
||||
if (applink.icon) {
|
||||
if (!validator.isBase64(applink.icon)) throw new BoxError(BoxError.BAD_FIELD, 'icon is not base64');
|
||||
applink.icon = Buffer.from(applink.icon, 'base64');
|
||||
}
|
||||
}
|
||||
|
||||
await amendIconAndLabel(applink);
|
||||
|
||||
const query = 'UPDATE applinks SET label=?, icon=?, upstreamUri=?, tagsJson=?, accessRestrictionJson=? WHERE id = ?';
|
||||
|
||||
Reference in New Issue
Block a user