Skip to content

Commit

Permalink
bug fixed
Browse files Browse the repository at this point in the history
  • Loading branch information
Ceiceiceii committed Nov 9, 2023
1 parent 7316203 commit e115a95
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions back-end/src/routes/modifyFavListRouter.mjs
Original file line number Diff line number Diff line change
@@ -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) => {
Expand Down
15 changes: 8 additions & 7 deletions front-end/src/pages/AccountEdit/AccountEdit.jsx
Original file line number Diff line number Diff line change
@@ -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';
Expand Down Expand Up @@ -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) => {
Expand Down Expand Up @@ -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}],
}
}
Expand Down

0 comments on commit e115a95

Please sign in to comment.