diff --git a/back-end/src/routes/modifyFavListRouter.mjs b/back-end/src/routes/modifyFavListRouter.mjs index 30903dc..b068e95 100644 --- a/back-end/src/routes/modifyFavListRouter.mjs +++ b/back-end/src/routes/modifyFavListRouter.mjs @@ -1,8 +1,8 @@ let arts = [ // Sample data structure - { id: '1', name: 'art1', author: 'Leonardo da Vinci', year: '4321', url: 'https://picsum.photos/200', inFavList: true }, + { id: '1', name: 'art1', author: 'Leonardo da Vinci', year: '4321', url: 'https://picsum.photos/200', inFavList: false }, { id: '2', name: 'art2', author: 'XXXXXX', year: '1234', url: 'https://picsum.photos/200', inFavList: false }, - + { id: '3', name: 'art3', author: 'XXXXXX', year: '2222', url: 'https://picsum.photos/200', inFavList: false }, ]; // export const removeFavListRouter = (req, res) => { diff --git a/front-end/src/pages/AccountEdit/AccountEdit.jsx b/front-end/src/pages/AccountEdit/AccountEdit.jsx index 1a35243..8e46ae2 100644 --- a/front-end/src/pages/AccountEdit/AccountEdit.jsx +++ b/front-end/src/pages/AccountEdit/AccountEdit.jsx @@ -1,5 +1,5 @@ import React, { useState } from 'react'; -import { useNavigate } from 'react-router-dom'; +import { useNavigate, useLocation } from 'react-router-dom'; import PopupContent from '../../components/popup/popupContent'; import ProfilePic from '../../components/account/profilePic'; import UserBasicInfo from '../../components/account/userBasicInfo'; @@ -34,13 +34,14 @@ const AccountEdit = (props) => { evt.preventDefault() evt.stopPropagation() } - const confirmLogout = (evt) => { - evt.preventDefault() - evt.stopPropagation() - } + // const confirmLogout = (evt) => { + // evt.preventDefault() + // evt.stopPropagation() + // } const confirmLogOutAccount = (evt) => { evt.preventDefault() - navigate("/login", { state: { from: location.pathname } }); + // navigate("/login", { state: { from: location.pathname } }); + navigate("/login"); } const confirmDeleteAccount = async (evt) => { @@ -95,7 +96,7 @@ const AccountEdit = (props) => { "deleteAccount": { link: "Delete Account", title: "You will not be able to recover this account", - buttons: [{value:"Okay", handleClick: deleteAccount}, + buttons: [{value:"Okay", handleClick: confirmDeleteAccount}, {value:"Discard", handleClick: discardChange}], } }