From c81c4a55aa679e35a9716fbb3e49cd9c715be248 Mon Sep 17 00:00:00 2001 From: Lee Araneta Date: Mon, 5 Aug 2024 22:20:59 -0400 Subject: [PATCH] feat: add privacy policy, allow user to delete account --- lib/snippit/users.ex | 5 + .../components/layouts/root.html.heex | 7 +- .../controllers/page_controller.ex | 9 -- .../controllers/page_html/hello.html.heex | 62 --------- lib/snippit_web/live/add_snippet_live.ex | 31 +++-- lib/snippit_web/live/hello_live.ex | 123 ++++++++++++++++++ lib/snippit_web/live/home_live.ex | 43 ++++++ lib/snippit_web/router.ex | 3 +- lib/snippit_web/user_auth.ex | 2 +- 9 files changed, 194 insertions(+), 91 deletions(-) delete mode 100644 lib/snippit_web/controllers/page_controller.ex create mode 100644 lib/snippit_web/live/hello_live.ex diff --git a/lib/snippit/users.ex b/lib/snippit/users.ex index a26d6e7..ee5ef4f 100644 --- a/lib/snippit/users.ex +++ b/lib/snippit/users.ex @@ -105,4 +105,9 @@ defmodule Snippit.Users do {:ok, _} = create_collection_invites_from_app_invites(user) {:ok, user} end + + def delete_user(%User{} = user) do + {:ok, user} = Repo.delete(user) + {:ok, user} + end end diff --git a/lib/snippit_web/components/layouts/root.html.heex b/lib/snippit_web/components/layouts/root.html.heex index b79a5e9..e118ab5 100644 --- a/lib/snippit_web/components/layouts/root.html.heex +++ b/lib/snippit_web/components/layouts/root.html.heex @@ -4,7 +4,7 @@ - <.live_title suffix=" ยท Phoenix Framework"> + <.live_title> <%= assigns[:page_title] || "Snippit" %> @@ -15,7 +15,10 @@ <%= if @current_user do %>