diff options
| author | syuilo <syuilotan@yahoo.co.jp> | 2017-03-03 08:56:07 +0900 |
|---|---|---|
| committer | syuilo <syuilotan@yahoo.co.jp> | 2017-03-03 08:56:07 +0900 |
| commit | dc45055f2ffcea2369f12d104999746220b22c90 (patch) | |
| tree | d3ec8f4a03076fe804c906cd60656e197f3010f2 /src/api/endpoints/i/appdata/get.js | |
| parent | wip (diff) | |
| download | misskey-dc45055f2ffcea2369f12d104999746220b22c90.tar.gz misskey-dc45055f2ffcea2369f12d104999746220b22c90.tar.bz2 misskey-dc45055f2ffcea2369f12d104999746220b22c90.zip | |
wip
Diffstat (limited to 'src/api/endpoints/i/appdata/get.js')
| -rw-r--r-- | src/api/endpoints/i/appdata/get.js | 53 |
1 files changed, 0 insertions, 53 deletions
diff --git a/src/api/endpoints/i/appdata/get.js b/src/api/endpoints/i/appdata/get.js deleted file mode 100644 index 7f1bdf0713..0000000000 --- a/src/api/endpoints/i/appdata/get.js +++ /dev/null @@ -1,53 +0,0 @@ -'use strict'; - -/** - * Module dependencies - */ -import Appdata from '../../../models/appdata'; - -/** - * Get app data - * - * @param {any} params - * @param {any} user - * @param {any} app - * @param {Boolean} isSecure - * @return {Promise<any>} - */ -module.exports = (params, user, app, isSecure) => - new Promise(async (res, rej) => -{ - // Get 'key' parameter - let key = params.key; - if (key === undefined) { - key = null; - } - - if (isSecure) { - if (!user.data) { - return res(); - } - if (key !== null) { - const data = {}; - data[key] = user.data[key]; - res(data); - } else { - res(user.data); - } - } else { - const select = {}; - if (key !== null) { - select['data.' + key] = true; - } - const appdata = await Appdata.findOne({ - app_id: app._id, - user_id: user._id - }, select); - - if (appdata) { - res(appdata.data); - } else { - res(); - } - } -}); |