summaryrefslogtreecommitdiff
path: root/src/api/endpoints/i/appdata
diff options
context:
space:
mode:
authorAya Morisawa <AyaMorisawa4869@gmail.com>2017-04-14 20:45:37 +0900
committerAya Morisawa <AyaMorisawa4869@gmail.com>2017-04-14 20:45:37 +0900
commitb095efaee59572800244b34564692fd999cc4ded (patch)
tree89a2a1401b2af797bb687d0d79cfb5e9e52d987e /src/api/endpoints/i/appdata
parentFix tslint.json (diff)
downloadsharkey-b095efaee59572800244b34564692fd999cc4ded.tar.gz
sharkey-b095efaee59572800244b34564692fd999cc4ded.tar.bz2
sharkey-b095efaee59572800244b34564692fd999cc4ded.zip
Migrate to tslint 5.1.0
Diffstat (limited to 'src/api/endpoints/i/appdata')
-rw-r--r--src/api/endpoints/i/appdata/get.ts6
-rw-r--r--src/api/endpoints/i/appdata/set.ts12
2 files changed, 9 insertions, 9 deletions
diff --git a/src/api/endpoints/i/appdata/get.ts b/src/api/endpoints/i/appdata/get.ts
index 47e1b8d202..a1a57fa13a 100644
--- a/src/api/endpoints/i/appdata/get.ts
+++ b/src/api/endpoints/i/appdata/get.ts
@@ -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);
diff --git a/src/api/endpoints/i/appdata/set.ts b/src/api/endpoints/i/appdata/set.ts
index eea17fd0d8..07178d6507 100644
--- a/src/api/endpoints/i/appdata/set.ts
+++ b/src/api/endpoints/i/appdata/set.ts
@@ -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);
}