egirlskey/src/server/api/endpoints/i.ts
syuilo 2756f553c6
Improve error handling of API (#4345)
* wip

* wip

* wip

* Update attached_notes.ts

* wip

* Refactor

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* Update call.ts

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* wip

* ✌️

* Fix
2019-02-22 11:46:58 +09:00

29 lines
512 B
TypeScript

import { pack } from '../../../models/user';
import define from '../define';
export const meta = {
stability: 'stable',
desc: {
'ja-JP': '自分のアカウント情報を取得します。'
},
requireCredential: true,
params: {},
res: {
type: 'entity',
entity: 'User'
}
};
export default define(meta, async (ps, user, app) => {
const isSecure = user != null && app == null;
return await pack(user, user, {
detail: true,
includeHasUnreadNotes: true,
includeSecrets: isSecure
});
});