Commit 500e9eaf authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent 32794545
This diff is collapsed.
...@@ -6,8 +6,9 @@ import { isAuthenticated } from './utils/auth' ...@@ -6,8 +6,9 @@ import { isAuthenticated } from './utils/auth'
import { Redirect } from 'react-router-dom' import { Redirect } from 'react-router-dom'
const INIT_PAGE = { const INIT_PAGE = {
name: '', bookmark: ['제주도'],
bookmark: [] bookmark: ['한라산'],
} }
const user = isAuthenticated() const user = isAuthenticated()
...@@ -16,15 +17,14 @@ function Bookmark() { ...@@ -16,15 +17,14 @@ function Bookmark() {
const [page, setPage] = useState(INIT_PAGE) const [page, setPage] = useState(INIT_PAGE)
const [error, setError] = useState('') const [error, setError] = useState('')
async function handleSubmit(event) { const user = isAuthenticated()
event.preventDefault()
async function getBookmark(user) {
try { try {
setError('') setError('')
const response = await axios.post('/api/users/bookmark',page) const response = await axios.post(`/api/users/bookmark/${user}`)
console.log(page) setPage(response.data)
// setUser(INIT_USER)
} catch (error) { } catch (error) {
console.log(error)
catchErrors(error, setError) catchErrors(error, setError)
} }
} }
...@@ -45,8 +45,8 @@ function Bookmark() { ...@@ -45,8 +45,8 @@ function Bookmark() {
</Navbar> </Navbar>
<Form> <Form>
<ListGroup> <ListGroup>
<ListGroup.Item action href="">북마크1</ListGroup.Item> <ListGroup.Item value={page.bookmark}></ListGroup.Item>
<ListGroup.Item>북마크2</ListGroup.Item> <ListGroup.Item></ListGroup.Item>
</ListGroup> </ListGroup>
</Form> </Form>
</Container> </Container>
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment