本文整理匯總了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);}
}