Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…chathon into dev
  • Loading branch information
EarlyRiser42 committed Oct 14, 2023
2 parents b295de5 + f591c1b commit 9f6b241
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 11 deletions.
18 changes: 11 additions & 7 deletions netlify.toml
Original file line number Diff line number Diff line change
@@ -1,18 +1,22 @@
[[redirects]]
from = "/api/850/*"
to = "https://8508958360.for-seoul.synctreengine.com"
from = "/api/904/*"
to = "https://9042753645.for-seoul.synctreengine.com/:splat"
status = 200
force = true

[[redirects]]
from = "/api/246/*"
to = "https://2468280591.for-seoul.synctreengine.com"
from = "/api/850/*"
to = "https://8508958360.for-seoul.synctreengine.com/:splat"
status = 200
force = true


[[redirects]]
from = "/api/904/*"
to = "https://9042753645.for-seoul.synctreengine.com"
from = "/api/246/*"
to = "https://2468280591.for-seoul.synctreengine.com/:splat"
status = 200
force = true

[[redirects]]
from = "/*"
to = "/index.html"
status = 200
1 change: 0 additions & 1 deletion public/_redirects

This file was deleted.

25 changes: 22 additions & 3 deletions src/App.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,12 @@ import Login from './pages/Login.jsx'
import SignUp from './pages/Signup.jsx'
import Layout from './Layout.jsx'
import Detail from './pages/Detail.jsx'
import { useEffect, useState } from 'react'
import { useContext, useEffect, useState } from 'react'
import AuthProvider from './provider/userProvider'
import axios from 'axios'
import CardHousing from './components/CardHousing.jsx'
import Loading from './components/Loading.jsx'
import { AuthContext } from './provider/userContext'

function App() {
/* userCards는 유저의 카드, searchedCards는 유저가 카테고리를 클릭하거나, 검색을 했을 경우 화면에 보여지는 카드 */
Expand All @@ -20,6 +21,7 @@ function App() {
const location = useLocation()
const background = location.state && location.state.background
const [loading, setLoading] = useState(false)
const user = useContext(AuthContext)

// 서버에서 유저 카드 정보 가져오기 데모 코드 : 실제론 fetch 말고 axios 사용하는게 좋을 듯
// useEffect(() => {
Expand All @@ -35,15 +37,32 @@ function App() {
useEffect(() => {
const fetchData = async () => {
try {
const res = await axios.get('/api/904/insurance_list')
console.log(res)
const res = await axios.get('/api/904/insurance_list', {
headers: { 'Content-Type': 'application/json' },
})
console.log('보험정보', res)
} catch (e) {
console.log(e)
}
}
fetchData()
})

useEffect(() => {
const fetchUserData = async () => {
try {
const res = await axios.post('api/850/login_get_card', {
uid: 'receaGGFLSVcHUroH',
})
console.log('유저카드정보', res)
} catch (e) {
console.log(e)
}
}

fetchUserData()
}, [user])

return (
<div>
{loading && <Loading />}
Expand Down

0 comments on commit 9f6b241

Please sign in to comment.