本文整理汇总了TypeScript中server/agents/account-agent.remove函数的典型用法代码示例。如果您正苦于以下问题:TypeScript remove函数的具体用法?TypeScript remove怎么用?TypeScript remove使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了remove函数的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的TypeScript代码示例。
示例1: async
test.serial('パスワード変更の入力値検証 - メールアドレス以外に認証手段がある時はパスワードなしに変更できること', async (t) =>
{
const log = slog.stepIn('test', t['_test'].title);
let account : Account =
{
email: 'admin@example.com',
password: '12345678',
twitter: 'twitter'
};
account.password = Utils.getHashPassword(account.email, account.password, Config.PASSWORD_SALT);
account = await AccountAgent.add(account);
const param : Request.ChangePassword =
{
oldPassword: '12345678',
newPassword: null,
confirm: null,
};
const result = await isChangePasswordValid(param, account.id, locale);
const {status} = result.response;
t.is(status, Response.Status.OK);
await AccountAgent.remove(account.id);
log.stepOut();
});
示例2: onDeleteAccount
export async function onDeleteAccount(req : express.Request, res : express.Response)
{
const log = slog.stepIn('SettingsApi', 'onDeleteAccount');
try
{
const session : Session = req.ext.session;
const accountId = session.account_id;
const account = await AccountAgent.find(accountId);
AccountAgent.encrypt(account);
await DeleteAccountAgent.add(account);
await AccountAgent.remove( accountId);
await SessionAgent.logout({accountId});
// req.logout();
const data : Response.DeleteAccount = {status:Response.Status.OK};
res.json(data);
log.stepOut();
}
catch (err) {Utils.internalServerError(err, res, log);}
}