diff --git a/app/dashboard/templates/dashboard/index.html b/app/dashboard/templates/dashboard/index.html
index dab6005d..340cb50e 100644
--- a/app/dashboard/templates/dashboard/index.html
+++ b/app/dashboard/templates/dashboard/index.html
@@ -110,34 +110,31 @@
-
+
+
@@ -412,7 +409,7 @@
$(".custom-switch-input").change(async function (e) {
let aliasId = $(this).data("alias");
- let alias = $(this).parent().find(".alias").val();
+ let alias = $(this).data("alias-email");
try {
let res = await fetch(`/api/aliases/${aliasId}/toggle`, {
diff --git a/app/dashboard/views/index.py b/app/dashboard/views/index.py
index 6f94a600..433e934e 100644
--- a/app/dashboard/views/index.py
+++ b/app/dashboard/views/index.py
@@ -63,23 +63,6 @@ def index():
else:
flash(f"You need to upgrade your plan to create new alias.", "warning")
- elif request.form.get("form-name") == "switch-email-forwarding":
- alias_id = request.form.get("alias-id")
- alias: Alias = Alias.get(alias_id)
-
- LOG.d("switch email forwarding for %s", alias)
-
- alias.enabled = not alias.enabled
- if alias.enabled:
- flash(f"Alias {alias.email} is enabled", "success")
- else:
- flash(f"Alias {alias.email} is disabled", "warning")
-
- db.session.commit()
- return redirect(
- url_for("dashboard.index", highlight_alias_id=alias.id, query=query)
- )
-
elif request.form.get("form-name") == "delete-email":
alias_id = request.form.get("alias-id")
alias: Alias = Alias.get(alias_id)