diff --git a/admin/pages/admins/index.tsx b/admin/pages/admins/index.tsx index e8c9df9..63340cf 100644 --- a/admin/pages/admins/index.tsx +++ b/admin/pages/admins/index.tsx @@ -23,7 +23,7 @@ const AdminsPage = () => { const { data, error } = await supabase .from("admins_roles_restaurants") .select("*, admins(id, name, email), roles(name)") - .order('id', { ascending: false }) + .order("id", { ascending: false }) .range((page - 1) * pageSize, pageSize * page - 1) .eq("restaurant_id", user.split("/")[2]) .neq("admin_id", user.split("/")[0]); @@ -71,13 +71,12 @@ const AdminsPage = () => { fetchAdmins(currentPage); }, [currentPage]); - const deleteRecord = async (id: number, relativeId: number) => { + const deleteRecord = async (id: number) => { try { - await supabase.from("admins").delete().eq("id", id).throwOnError(); await supabase .from("admins_roles_restaurants") .delete() - .eq("id", relativeId) + .eq("id", id) .throwOnError(); setAdminsData(adminsData.filter((x) => x.id != id)); fetchCountAdmins(); @@ -188,7 +187,7 @@ const AdminsPage = () => { className="text-red" onClick={() => confirm("Are you sure you want to delete this admin?") - ? deleteRecord(admin.admins.id, admin.id) + ? deleteRecord(admin.id) : "" } > diff --git a/admin/pages/invited-members/add/index.tsx b/admin/pages/invited-members/add/index.tsx index ca4824e..73cf71b 100644 --- a/admin/pages/invited-members/add/index.tsx +++ b/admin/pages/invited-members/add/index.tsx @@ -96,7 +96,7 @@ const InvitedMemberPage = () => { await sendEmail({ to: email, - subject: "Bite Space - Invitation To Join Space", + subject: "Invitation To Join Space", message: render( InviteMemberEmail({ invited_by: data.admins.name, diff --git a/website/components/BottomSheet/index.tsx b/website/components/BottomSheet/index.tsx index fa08f84..686a930 100644 --- a/website/components/BottomSheet/index.tsx +++ b/website/components/BottomSheet/index.tsx @@ -31,23 +31,31 @@ const BottomSheet = ({ }; }, [isOpen, onClose]); + const handleClose = () => { + if (window.history.state?.bottomSheetOpen) { + window.history.back(); + } else { + onClose(); + } + }; + return (
{name} dishes
+{name}
+
{data.name}
diff --git a/website/pages/restaurants/[restaurant]/categories/[category].tsx b/website/pages/restaurants/[restaurant]/categories/[category].tsx index 429fe27..56caab5 100644 --- a/website/pages/restaurants/[restaurant]/categories/[category].tsx +++ b/website/pages/restaurants/[restaurant]/categories/[category].tsx @@ -212,7 +212,7 @@ const RestaurantCategory = ({ Back | -{categoryData.name} dishes
+{categoryData.name}
{menuName} dishes
+{menuName}