apps: add icon and appStoreIcon to database
This commit is contained in:
@@ -93,10 +93,10 @@ function getApps(req, res, next) {
|
||||
function getAppIcon(req, res, next) {
|
||||
assert.strictEqual(typeof req.resource, 'object');
|
||||
|
||||
apps.getIconPath(req.resource, { original: req.query.original }, function (error, iconPath) {
|
||||
apps.getIcon(req.resource, { original: req.query.original }, function (error, icon) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
res.sendFile(iconPath);
|
||||
res.send(icon);
|
||||
});
|
||||
}
|
||||
|
||||
@@ -214,7 +214,7 @@ function setIcon(req, res, next) {
|
||||
|
||||
if (req.body.icon !== null && typeof req.body.icon !== 'string') return next(new HttpError(400, 'icon is null or a base-64 image string'));
|
||||
|
||||
apps.setIcon(req.resource, req.body.icon, auditSource.fromRequest(req), function (error) {
|
||||
apps.setIcon(req.resource, req.body.icon || null /* empty string means null */, auditSource.fromRequest(req), function (error) {
|
||||
if (error) return next(BoxError.toHttpError(error));
|
||||
|
||||
next(new HttpSuccess(200, {}));
|
||||
|
||||
Reference in New Issue
Block a user