Commit 8a09b651 authored by Lee SeoYeon's avatar Lee SeoYeon
Browse files

.

parent d0e82382
This diff is collapsed.
...@@ -21,7 +21,7 @@ function Login() { ...@@ -21,7 +21,7 @@ function Login() {
useEffect(() => { //참거짓 판단 값들의 원소들이 element로 들어간다 useEffect(() => { //참거짓 판단 값들의 원소들이 element로 들어간다
const isUser = Object.values(user).every(el => Boolean(el)) const isUser = Object.values(user).every(el => Boolean(el))
isUser ? setDisabled(false) : setDisabled(true) isUser ? setDisabled(false) : setDisabled(true)
}, [user]) }, [user])
function handleChange(event) { function handleChange(event) {
...@@ -33,10 +33,10 @@ function Login() { ...@@ -33,10 +33,10 @@ function Login() {
event.preventDefault() //리셋을 막는다 event.preventDefault() //리셋을 막는다
try { try {
setLoading(true) setLoading(true)
setError('') setError('') //값을 배열로 설정
const response = await axios.post('/api/auth/login', user) const response = await axios.post('/api/auth/login', user)
console.log(response.data) console.log(response.data)
handleLogin(response.data.userId) handleLogin(response.data.userId)//로그인했을때 userid data를 넣는다
setSuccess(true) setSuccess(true)
} catch (error) { } catch (error) {
catchErrors(error, setError) catchErrors(error, setError)
......
...@@ -11,7 +11,7 @@ import axios from "axios"; ...@@ -11,7 +11,7 @@ import axios from "axios";
const INIT_PAGE = { const INIT_PAGE = {
title: '', title: '',
url: '', url: '',
} } //초기페이지에 타이틀이랑 url 저장
function Search(props) { function Search(props) {
const endPage = 10; const endPage = 10;
......
...@@ -7,7 +7,7 @@ async function connectDb() { ...@@ -7,7 +7,7 @@ async function connectDb() {
if (connection.isConnected) { if (connection.isConnected) {
return return
} }
//디비연결
const db = await mongoose.connect(config.mongoDbUri, { const db = await mongoose.connect(config.mongoDbUri, {
useNewUrlParser: true, useNewUrlParser: true,
useUnifiedTopology: true, useUnifiedTopology: true,
......
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