Toggle navigation
Toggle navigation
This project
Loading...
Sign in
정성훈
/
MEALKHU
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
1
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
swa07016
2020-06-22 13:23:00 +0900
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
1e2b079ef87cacc2e0cb5e3f219f26b2f6d828d7
1e2b079e
1 parent
d2cd6015
warning 코드 정리
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
4 additions
and
8 deletions
client/src/components/NavBar.js
client/src/components/PickedCard.js
client/src/pages/LandingPage.js
server.js
client/src/components/NavBar.js
View file @
1e2b079
...
...
@@ -19,7 +19,7 @@ const NavBar = (props) => {
<
Navbar
style
=
{{
'backgroundColor'
:
'#940f0f'
,
'display'
:
'block'
}}
light
expand
=
"md"
fixed
=
"top"
>
<
Container
className
=
"themed-container"
>
<
span
>
<
a
href
=
'/'
><
img
src
=
"logo.png"
width
=
"50"
/><
/a
>
<
a
href
=
'/'
><
img
src
=
"logo.png"
alt
=
"logo"
width
=
"50"
/><
/a
>
<
/span
>
<
NavbarBrand
href
=
"/"
style
=
{{
'marginLeft'
:
'1.5rem'
,
'color'
:
'#fff'
}}
>
MEALKHU
<
/NavbarBrand
>
<
NavbarToggler
onClick
=
{
toggle
}
/
>
...
...
@@ -35,7 +35,7 @@ const NavBar = (props) => {
<
NavLink
href
=
"/mypick"
style
=
{{
'color'
:
'#fff'
}}
>
MyPick
<
/NavLink
>
<
/NavItem
>
<
/Nav
>
<
NavbarText
><
a
href
=
"http://khuhub.khu.ac.kr/2019102227/TermProject"
target
=
"_blank"
rel
=
"noopener"
style
=
{{
'color'
:
'#fff'
,
'textDecoration'
:
'none'
}}
>
OSS
Project
<
/a></
NavbarText
>
<
NavbarText
><
a
href
=
"http://khuhub.khu.ac.kr/2019102227/TermProject"
target
=
"_blank"
rel
=
"noopener
noreferrer
"
style
=
{{
'color'
:
'#fff'
,
'textDecoration'
:
'none'
}}
>
OSS
Project
<
/a></
NavbarText
>
<
/Collapse>
<
/Container
>
<
/Navbar
>
...
...
client/src/components/PickedCard.js
View file @
1e2b079
...
...
@@ -41,7 +41,7 @@ const MealCard = (props) => {
}).
then
(
response
=>
response
.
json
())
.
then
(
result
=>
{
if
(
result
.
message
===
'delete success'
)
{
alert
(
'
delete success
'
);
alert
(
'
삭제 완료
'
);
window
.
location
.
href
=
"/mypick"
;
}
else
if
(
result
.
message
===
'delete error'
)
{
alert
(
'delete error'
);
...
...
client/src/pages/LandingPage.js
View file @
1e2b079
...
...
@@ -11,7 +11,6 @@ const LandingPage = (props) => {
const
[
datas
,
setDatas
]
=
useState
([]);
const
[
filteredDatas
,
setFilteredDatas
]
=
useState
([]);
const
[
RandomCards
,
setRandomCards
]
=
useState
([]);
const
[
isLoading
,
setIsLoading
]
=
useState
(
false
);
const
[
all
,
setAll
]
=
useState
(
false
);
const
[
Kfood
,
setKfood
]
=
useState
(
false
);
const
[
Cfood
,
setCfood
]
=
useState
(
false
);
...
...
@@ -28,16 +27,13 @@ const LandingPage = (props) => {
const
fetchData
=
async
()
=>
{
const
result
=
await
axios
(
'/api/datas'
,
// localhost로 바꾸기
);
setDatas
(
result
.
data
);
setIsLoading
(
true
);
};
fetchData
();
},
[]);
useEffect
(()
=>
{
setIsLoading
(
false
);
let
result
=
[];
const
states
=
[
Kfood
,
Cfood
,
Jfood
,
meat
,
snackfood
,
pub
,
fastfood
,
cafe
,
etc
];
const
types
=
[[
'한식'
],
[
'중식'
],
[
'일식'
],
[
'고기'
],
[
'분식'
],
[
'호프'
,
'술집'
],
[
'패스트푸드'
],
[
'카페'
,
'디저트'
],
[
'기타'
]];
...
...
@@ -54,7 +50,6 @@ const LandingPage = (props) => {
}
}
setFilteredDatas
(
result
);
setIsLoading
(
true
);
},
[
Kfood
,
Cfood
,
Jfood
,
meat
,
snackfood
,
pub
,
fastfood
,
cafe
,
etc
,
datas
]);
useEffect
(()
=>
{
...
...
server.js
View file @
1e2b079
...
...
@@ -179,6 +179,7 @@ app.get("/api/mypicks", (req, res) => {
let
temp
=
iconv
.
decode
(
dataBuffer
,
"EUC-KR"
);
connection
.
query
(
`SELECT pick FROM USER WHERE NAME='
${
username
}
';`
,
(
err
,
rows
,
fileds
)
=>
{
let
user_picks
=
rows
[
0
].
pick
.
split
(
','
);
temp
=
JSON
.
parse
(
temp
);
user_picks
.
pop
();
...
...
Please
register
or
login
to post a comment