import React, { useState } from 'react' import { Card, Image, Container, Row, Col, Table, Accordion, Button, Form } from 'react-bootstrap' import { Link } from 'react-router-dom'; import person from '../person.svg'; import mypagetiger from '../mypagetiger.svg'; import axios from 'axios' import catchErrors from '../utils/catchErrors'; import { isAuthenticated } from '../utils/auth'; const INIT_ACCOUNT = { name: "", avatar: { person } } function EditAccount() { const [account, setAccount] = useState(INIT_ACCOUNT) const [error, setError] = useState("") const user = isAuthenticated() const handleChange = (event) => { const { name, value, files } = event.target if (files) { for (const file of files) { console.log("name=", name, "value=", value, 'file=', file); } setAccount({ ...account, [name]: files }) } else { console.log("name=", name, "value=", value); setAccount({ ...account, [name]: value }) } } const handleSubmit = async (event) => { event.preventDefault() //form-data에 설정 const formData = new FormData() formData.append('name', account.name) formData.append('avatar', account.avatar[0]) //서버전송 try { if (user) { console.log(user) const response = await axios.put(`/api/users/account/${user}`, formData) } } catch (error) { catchErrors(error, setError) } } return (

My Page

{person.name}

KU# {/* 홈페이지로 돌아가기 */} 를 방문해주신 {account.name} 님,

진심으로 환영합니다! 즐거운 쇼핑 되세요.

* 문의 : shoppingmall_KU@korea.ac.kr {/* 쇼핑몰 문의 메일보내기 */}
주문현황 배송중 배송완료
케이시앵글부츠(SH) Mark Otto
2 Jacob Thornton
3 Larry the Bird
) } export default EditAccount