Migrate to tslint 5.1.0

This commit is contained in:
Aya Morisawa
2017-04-14 20:45:37 +09:00
parent 798d1610f0
commit b095efaee5
16 changed files with 107 additions and 95 deletions

View File

@ -32,14 +32,14 @@ module.exports = (params, user, app, isSecure) => new Promise(async (res, rej) =
} else {
const select = {};
if (key !== null) {
select['data.' + key] = true;
select[`data.${key}`] = true;
}
const appdata = await Appdata.findOne({
app_id: app._id,
user_id: user._id
}, {
fields: select
});
fields: select
});
if (appdata) {
res(appdata.data);

View File

@ -37,10 +37,10 @@ module.exports = (params, user, app, isSecure) => new Promise(async (res, rej) =
let set = {};
if (data) {
Object.entries(data).forEach(([k, v]) => {
set['data.' + k] = v;
set[`data.${k}`] = v;
});
} else {
set['data.' + key] = value;
set[`data.${key}`] = value;
}
if (isSecure) {
@ -63,10 +63,10 @@ module.exports = (params, user, app, isSecure) => new Promise(async (res, rej) =
app_id: app._id,
user_id: user._id
}, {
$set: set
}), {
upsert: true
});
$set: set
}), {
upsert: true
});
res(204);
}