import { changeTwoFactor } from "../domain/userModel";
import { UpdateUserStore, updateUserUseCase } from "./updateUserUseCase";

const toggleUserTwoFactorUseCase = (
  store: UpdateUserStore,
) => {
  return updateUserUseCase<"twoFactorEnabled">(store, changeTwoFactor, !store.user?.twoFactorEnabled);
};

export { toggleUserTwoFactorUseCase };
