completeChallenge method
Future<void>
completeChallenge(
- DatabaseSession session,
- EmailAccountOtpLoginRequest emailAccountOtpLoginRequest, {
- Transaction? transaction,
Detaches the relation between this EmailAccountOtpLoginRequest and the SecretChallenge set in completeChallenge
by setting the EmailAccountOtpLoginRequest's foreign key completeChallengeId to null.
This removes the association between the two models without deleting the related record.
Implementation
Future<void> completeChallenge(
_is.DatabaseSession session,
EmailAccountOtpLoginRequest emailAccountOtpLoginRequest, {
_is.Transaction? transaction,
}) async {
if (emailAccountOtpLoginRequest.id == null) {
throw ArgumentError.notNull('emailAccountOtpLoginRequest.id');
}
var $emailAccountOtpLoginRequest = emailAccountOtpLoginRequest.copyWith(
completeChallengeId: null,
);
await session.db.updateRow<EmailAccountOtpLoginRequest>(
$emailAccountOtpLoginRequest,
columns: [EmailAccountOtpLoginRequest.t.completeChallengeId],
transaction: transaction,
);
}