lint
This commit is contained in:
@@ -12,14 +12,14 @@ exports = module.exports = {
|
||||
|
||||
const assert = require('assert'),
|
||||
apps = require('./apps.js'),
|
||||
database = require('./database.js'),
|
||||
BoxError = require('./boxerror.js'),
|
||||
uuid = require('uuid'),
|
||||
database = require('./database.js'),
|
||||
debug = require('debug')('box:applinks'),
|
||||
jsdom = require('jsdom'),
|
||||
safe = require('safetydance'),
|
||||
superagent = require('superagent'),
|
||||
validator = require('validator'),
|
||||
jsdom = require('jsdom'),
|
||||
debug = require('debug')('box:applinks');
|
||||
uuid = require('uuid'),
|
||||
validator = require('validator');
|
||||
|
||||
const APPLINKS_FIELDS= [ 'id', 'accessRestrictionJson', 'creationTime', 'updateTime', 'ts', 'label', 'tagsJson', 'icon', 'upstreamUri' ].join(',');
|
||||
|
||||
@@ -144,8 +144,6 @@ async function update(applinkId, applink) {
|
||||
assert.strictEqual(typeof applink, 'object');
|
||||
assert.strictEqual(typeof applink.upstreamUri, 'string');
|
||||
|
||||
debug(`update: ${applinkId} ${applink.upstreamUri}`, 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');
|
||||
@@ -163,9 +161,7 @@ async function update(applinkId, applink) {
|
||||
async function remove(applinkId) {
|
||||
assert.strictEqual(typeof applinkId, 'string');
|
||||
|
||||
debug(`remove: ${applinkId}`);
|
||||
|
||||
const result = await database.query(`DELETE FROM applinks WHERE id = ?`, [ applinkId ]);
|
||||
const result = await database.query('DELETE FROM applinks WHERE id = ?', [ applinkId ]);
|
||||
if (result.affectedRows !== 1) throw new BoxError(BoxError.NOT_FOUND, 'Applink not found');
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user