1
0
mirror of https://github.com/misskey-dev/misskey synced 2024-12-21 10:08:24 +09:00
misskey/src/server/api/endpoints/i.ts
2018-03-29 20:32:18 +09:00

29 lines
519 B
TypeScript

/**
* Module dependencies
*/
import User, { pack } from '../../../models/user';
/**
* Show myself
*
* @param {any} params
* @param {any} user
* @param {any} app
* @param {Boolean} isSecure
* @return {Promise<any>}
*/
module.exports = (params, user, _, isSecure) => new Promise(async (res, rej) => {
// Serialize
res(await pack(user, user, {
detail: true,
includeSecrets: isSecure
}));
// Update lastUsedAt
User.update({ _id: user._id }, {
$set: {
'account.lastUsedAt': new Date()
}
});
});